forked from icsharpcode/ILSpy
-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (115 loc) · 5.39 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
name: Build ILSpy
on:
push:
branches: '**'
pull_request:
branches: [ master, release/** ]
jobs:
Build:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- configuration: debug
solution: ilspy.sln
channel: zip
- configuration: release
solution: ilspy.sln
channel: zip
- configuration: release
solution: ilspy.withpackage.sln
channel: ci
- configuration: release
solution: ilspy.withpackage.sln
channel: store
env:
BuildPlatform: Any CPU
StagingDirectory: buildartifacts
steps:
- run: mkdir -p $env:StagingDirectory
- name: Force git to use crlf, otherwise dotnet-format --check fails
run: git config --global core.autocrlf true
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install dotnet-format
run: dotnet tool install dotnet-format --global --version 5.1.225507
- name: Get Version
id: version
shell: pwsh
run: |
.\BuildTools\ghactions-install.ps1
Get-ChildItem Env: | Where-Object {$_.Name -Match "^ILSPY_"} | %{ echo "::set-output name=$($_.Name)::$($_.Value)" }
- name: Restore the application
run: msbuild ${{ matrix.solution }} /t:Restore /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform
- name: Build
run: msbuild ${{ matrix.solution }} /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform /p:AppxPackageDir="${{ github.workspace }}\${{ env.StagingDirectory }}\${{ matrix.channel }}\"
env:
ReleaseChannel: ${{ matrix.channel }}
- name: Execute unit tests
run: dotnet test $env:Tests1 $env:Tests2 $env:Tests3
env:
Tests1: ICSharpCode.Decompiler.Tests\bin\${{ matrix.configuration }}\net472\ICSharpCode.Decompiler.Tests.exe
Tests2: ILSpy.Tests\bin\${{ matrix.configuration }}\net472\ILSpy.Tests.exe
Tests3: ILSpy.BamlDecompiler.Tests\bin\${{ matrix.configuration }}\net472\ILSpy.BamlDecompiler.Tests.exe
- name: Style - tab check
run: python BuildTools\tidy.py
- name: Zip ILSpy Release
if: matrix.channel == 'zip'
# run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip .\ILSpy\bin\${{ matrix.configuration }}\net472\*
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip .\ILSpy\bin\${{ matrix.configuration }}\net472\*.dll .\ILSpy\bin\${{ matrix.configuration }}\net472\*.exe .\ILSpy\bin\${{ matrix.configuration }}\net472\*.config .\ILSpy\bin\${{ matrix.configuration }}\net472\*\ILSpy.resources.dll .\ILSpy\bin\${{ matrix.configuration }}\net472\*\ILSpy.ReadyToRun.Plugin.resources.dll
# https://github.com/actions/upload-artifact
- name: Upload Store build artifacts
if: matrix.channel == 'store'
uses: actions/upload-artifact@v2
with:
name: MSIX Store Package
path: ${{ env.StagingDirectory }}\${{ matrix.channel }}\*.*
if-no-files-found: error
- name: Upload VSIX (VS 2019) release build artifacts
if: matrix.channel == 'zip' && matrix.configuration == 'release'
uses: actions/upload-artifact@v2
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.channel == 'zip' && matrix.configuration == 'release'
uses: actions/upload-artifact@v2
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 NuGet release build artifacts
if: matrix.channel == 'zip' && matrix.configuration == 'release'
uses: actions/upload-artifact@v2
with:
name: ICSharpCode.Decompiler NuGet Package (${{ matrix.configuration }})
path: ICSharpCode.Decompiler\bin\Release\ICSharpCode.Decompiler*.nupkg
if-no-files-found: error
- name: Publish NuGet
if: github.ref == 'refs/heads/master' && matrix.channel == 'zip' && 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 zip release build artifacts
if: matrix.channel == 'zip'
uses: actions/upload-artifact@v2
with:
name: ILSpy ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_binaries.zip
if-no-files-found: error
- name: Upload installer artifact
if: matrix.channel == 'zip' && matrix.configuration == 'release'
uses: actions/upload-artifact@v2
with:
name: ILSpy Installer ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.Installer\wix\*.msi
if-no-files-found: error