-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
202 lines (168 loc) · 8.58 KB
/
build-ilspy.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: Build ILSpy
on:
push:
branches: '**'
pull_request:
branches: [ master, release/** ]
jobs:
Build:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
Configuration: [ Debug, Release ]
env:
BuildPlatform: Any CPU
StagingDirectory: buildartifacts
steps:
- run: mkdir -p $env:StagingDirectory
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
env:
DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet
DOTNET_ROOT: ${{ runner.temp }}/.dotnet
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install dotnet-format
run: dotnet tool install -g dotnet-format --version "8.3.546805" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
- name: Get Version
id: version
shell: pwsh
run: |
.\BuildTools\ghactions-install.ps1
Get-ChildItem Env: | Where-Object {$_.Name -Match "^ILSPY_"} | %{ echo "$($_.Name)=$($_.Value)" } | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Restore the application
run: msbuild ILSpy.sln /t:Restore /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform
- name: Build
run: msbuild ILSpy.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform /m
- name: Execute unit tests
run: dotnet test --logger "junit;LogFileName=${{ matrix.configuration }}.xml" --results-directory test-results $env:Tests1 $env:Tests2 $env:Tests3
env:
Tests1: ICSharpCode.Decompiler.Tests\bin\${{ matrix.configuration }}\net8.0-windows\win-x64\ICSharpCode.Decompiler.Tests.dll
Tests2: ILSpy.Tests\bin\${{ matrix.configuration }}\net8.0-windows\ILSpy.Tests.dll
Tests3: ILSpy.BamlDecompiler.Tests\bin\${{ matrix.configuration }}\net8.0-windows\win-x64\ILSpy.BamlDecompiler.Tests.dll
- name: Upload Test Logs
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ matrix.configuration }}
path: 'test-results/${{ matrix.configuration }}.xml'
- name: Create Test Report
uses: test-summary/action@v2
if: always()
with:
paths: "test-results/${{ matrix.configuration }}.xml"
- name: Format check
run: dotnet-format whitespace --verify-no-changes --verbosity detailed ILSpy.sln
- name: Verify package contents
if: matrix.configuration == 'debug'
shell: pwsh
run: |
.\BuildTools\create-filelists.ps1
git diff --exit-code
- name: Zip ILSpy (framework-dependent)
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*.dll .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*.exe .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*.config .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*.json .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*\ILSpy.resources.dll .\ILSpy\bin\${{ matrix.configuration }}\net8.0-windows\*\ILSpy.ReadyToRun.Plugin.resources.dll
- name: Publish x64/arm64 framework-dependent/self-contained
shell: pwsh
run: .\publish.ps1
- name: Zip ILSpy Release (x64 self-contained)
if: matrix.configuration == 'release'
run: 7z a -tzip $env:StagingDirectory\ILSpy_selfcontained_x64.zip .\ILSpy\bin\Release\net8.0-windows\win-x64\publish\selfcontained\*
- name: Zip ILSpy Release (arm64 framework-dependent)
if: matrix.configuration == 'release'
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries_arm64.zip .\ILSpy\bin\Release\net8.0-windows\win-arm64\publish\fwdependent\*
- name: Build Installer (x64 and arm64, framework-dependent)
if: matrix.configuration == 'release'
run: |
msbuild ILSpy.Installer.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU"
msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU"
msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU" /p:PlatformForInstaller="ARM64"
- name: Build VS Extensions (for 2017-2019 and 2022)
if: matrix.configuration == 'release'
run: |
msbuild ILSpy.VSExtensions.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU"
msbuild ILSpy.VSExtensions.sln /p:Configuration="Release" /p:Platform="Any CPU"
# https://github.com/actions/upload-artifact
- name: Upload VSIX (VS 2019) release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ILSpy VS Addin for VS 2017-2019 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.AddIn\bin\${{ matrix.configuration }}\net472\*.vsix
if-no-files-found: error
- name: Upload VSIX (VS 2022) release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ILSpy VS Addin for VS 2022 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.AddIn.VS2022\bin\${{ matrix.configuration }}\net472\*.vsix
if-no-files-found: error
- name: Upload Decompiler NuGet release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.Decompiler NuGet Package (${{ matrix.configuration }})
path: ICSharpCode.Decompiler\bin\Release\ICSharpCode.Decompiler*.nupkg
if-no-files-found: error
- name: Publish Decompiler NuGet
if: github.ref == 'refs/heads/master' && matrix.configuration == 'release'
run: |
dotnet nuget push "ICSharpCode.Decompiler\bin\Release\ICSharpCode.Decompiler*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Upload ILSpyX NuGet release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.ILSpyX NuGet Package (${{ matrix.configuration }})
path: ICSharpCode.ILSpyX\bin\Release\ICSharpCode.ILSpyX*.nupkg
if-no-files-found: error
- name: Publish ILSpyX NuGet
if: github.ref == 'refs/heads/master' && matrix.configuration == 'release'
run: |
dotnet nuget push "ICSharpCode.ILSpyX\bin\Release\ICSharpCode.ILSpyX*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Upload zip binaries build artifacts
uses: actions/upload-artifact@v4
with:
name: ILSpy ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_binaries.zip
if-no-files-found: error
- name: Upload x64 self-contained zip (Release-only)
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ILSpy self-contained x64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_selfcontained_x64.zip
if-no-files-found: error
- name: Upload arm64 framework-dependent zip (Release-only)
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ILSpy arm64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_binaries_arm64.zip
if-no-files-found: error
- name: Upload x64 installer artifact
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ILSpy Installer x64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.Installer\wix\*-x64.msi
if-no-files-found: error
- name: Upload arm64 installer artifact
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ILSpy Installer arm64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.Installer\wix\*-arm64.msi
if-no-files-found: error
- name: Upload ilspycmd release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v4
with:
name: ilspycmd dotnet tool (${{ matrix.configuration }})
path: ICSharpCode.ILSpyCmd\bin\Release\ilspycmd*.nupkg
if-no-files-found: error