-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (89 loc) · 4.11 KB
/
Process.Extensions.yml
File metadata and controls
115 lines (89 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Process.Extensions
on:
workflow_dispatch:
push:
branches: [ main ]
env:
VERSION: "1.0"
PROFILE_WIN_64: win-x64
SOLUTION_FILE: Process.Extensions.sln
PE_PROJECT: ${{github.workspace}}\Process.Extensions\Process.Extensions.csproj
NUGET_SOURCE: https://api.nuget.org/v3/index.json
jobs:
build:
# Use the current configuration as the job name.
name: ${{matrix.configuration}}
# Use the 'windows-2022' image for CI.
runs-on: windows-2022
# Use the following configurations for building.
strategy:
matrix:
configuration: [ Debug, Release ]
steps:
# Downloads the latest Git repository for Process.Extensions.
- name: Clone Process.Extensions
uses: actions/checkout@v2
with:
submodules: recursive
# Installs the required SDKs for .NET.
- name: Install .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
# Restores the NuGet packages from the solution for all projects.
- name: Restore NuGet Packages
working-directory: ${{github.workspace}}
run: nuget restore ${{env.SOLUTION_FILE}}
# Patches the version number using the last 'Windows' workflow run number and the latest 'Process.Extensions' workflow run number.
- name: Patch Version Number
run: |
$version = "${{env.VERSION}}." + ${{github.run_number}}
echo "VERSION_RESOLVE=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
# Builds Process.Extensions using the PowerShell script.
- name: Build and Test Process.Extensions
working-directory: ${{github.workspace}}
run: ./Build.ps1 -Clean -Test -CommitID ${{github.sha}} -Configuration ${{matrix.configuration}} -Version ${{env.VERSION_RESOLVE}}
# Uploads the compiled Process.Extensions artifacts for 'win-x64'.
- name: Upload Process.Extensions Artifacts for Windows (x64)
uses: actions/upload-artifact@v4
with:
name: Process.Extensions-${{matrix.configuration}}-${{env.PROFILE_WIN_64}}
path: ${{github.workspace}}\Process.Extensions\bin\${{matrix.configuration}}\net8.0\
publish:
name: Publish
# Use the 'windows-2022' image for CI.
runs-on: windows-2022
steps:
# Downloads the latest Git repository for Process.Extensions.
- name: Clone Process.Extensions
uses: actions/checkout@v2
with:
submodules: recursive
# Installs the required SDKs for .NET.
- name: Install .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
# Restores the NuGet packages from the solution for all projects.
- name: Restore NuGet Packages
working-directory: ${{github.workspace}}
run: nuget restore ${{env.SOLUTION_FILE}}
# Patches the version number using the last 'Windows' workflow run number and the latest 'Process.Extensions' workflow run number.
- name: Patch Version Number
run: |
$version = "${{env.VERSION}}." + ${{github.run_number}}
echo "VERSION_RESOLVE=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
# Builds Process.Extensions using the PowerShell script.
- name: Build and Test Process.Extensions
working-directory: ${{github.workspace}}
run: ./Build.ps1 -Clean -Test -CommitID ${{github.sha}} -Configuration Release -Version ${{env.VERSION_RESOLVE}}
# Patches the assembly information stored in 'Process.Extensions.csproj' to use the current workflow version.
- name: Patch Version Information
run: |
./.github/workflows/Patch-Version.ps1 -ProjectPath "${{env.PE_PROJECT}}" -Version ${{env.VERSION_RESOLVE}} -CommitID ${{github.sha}}
# Builds Process.Extensions and packs it into a NuGet package.
- name: Create NuGet Package
run: dotnet pack "${{env.PE_PROJECT}}" /p:Configuration=Release
# Publishes the compiled package to NuGet.
- name: Publish to NuGet
run: dotnet nuget push "${{github.workspace}}\Process.Extensions\bin\Release\Process.Extensions.${{env.VERSION_RESOLVE}}.nupkg" -k ${{secrets.NUGET_KEY}} -s ${{env.NUGET_SOURCE}}