@@ -2,75 +2,74 @@ name: .NET Build + Test + Publish
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
66 pull_request :
7- branches : [ main ]
7+ branches : [main]
88
99jobs :
1010 build :
11-
12- runs-on : windows-latest
11+ runs-on : windows-2022
1312
1413 steps :
15- - uses : actions/checkout@v4
16- - uses : dsaltares/fetch-gh-release-asset@master
17- with :
18- repo : ' MattEqualsCoder/ALttPMSUShuffler'
19- file : ' msu_types.json'
20- target : ' MSURandomizerLibrary/msu_types.json'
21- token : ${{ secrets.GITHUB_TOKEN }}
22- - name : Setup .NET
23- uses : actions/setup-dotnet@v4
24- with :
25- dotnet-version : 9.0.x
26- - name : Restore dependencies
27- run : dotnet restore
28- - name : Build
29- run : dotnet build --no-restore -p:PostBuildEvent=
30- - name : Test
31- run : dotnet test --no-build --verbosity normal
32- - name : Clean
33- run : dotnet clean
34- - name : Build
35- if : ${{ github.event_name != 'pull_request' }}
36- run : dotnet build --no-restore --configuration Release -p:PostBuildEvent=
37- - name : Publish Windows 64bit
38- if : ${{ github.event_name != 'pull_request' }}
39- run : dotnet publish --os win --arch x64 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj
40- - name : Publish Windows 32bit
41- if : ${{ github.event_name != 'pull_request' }}
42- run : dotnet publish --os win --arch x86 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj
43- - name : Publish Linux 64bit
44- if : ${{ github.event_name != 'pull_request' }}
45- run : dotnet publish --os linux --arch x64 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj
46- - name : Publish Windows 64bit
47- if : ${{ github.event_name != 'pull_request' }}
48- run : dotnet publish -f net9.0
49- - name : Get version number
50- if : ${{ github.event_name != 'pull_request' }}
51- id : version
52- run : |
53- $version = (Get-Item "MSURandomizer\bin\Release\net9.0\win-x86\publish\MSURandomizer.exe").VersionInfo.ProductVersion
54- $version = $version -replace "\+.*", ""
55- Write-Output "number=$version" >> $env:GITHUB_OUTPUT
56- shell : pwsh
57- - name : Building the Windows installer
58- if : ${{ github.event_name != 'pull_request' }}
59- run : " \" %programfiles(x86)%/Inno Setup 6/iscc.exe\" \ " setup/MSURandomizer.iss\" "
60- shell : cmd
61- - name : Copy Nuget Packages
62- if : ${{ github.event_name != 'pull_request' }}
63- working-directory : setup
64- run : " ./CopyNugetPackages.ps1"
65- shell : pwsh
66- - name : Building the Linux 64bit package
67- if : ${{ github.event_name != 'pull_request' }}
68- working-directory : setup
69- run : " ./LinuxBuildZipper.ps1"
70- shell : pwsh
71- - name : Upload artifact
72- uses : actions/upload-artifact@v4
73- if : ${{ github.event_name != 'pull_request' }}
74- with :
75- path : " setup/Output/*"
76- name : MSURandomizer_${{ steps.version.outputs.number }}
14+ - uses : actions/checkout@v4
15+ - uses : dsaltares/fetch-gh-release-asset@master
16+ with :
17+ repo : " MattEqualsCoder/ALttPMSUShuffler"
18+ file : " msu_types.json"
19+ target : " MSURandomizerLibrary/msu_types.json"
20+ token : ${{ secrets.GITHUB_TOKEN }}
21+ - name : Setup .NET
22+ uses : actions/setup-dotnet@v4
23+ with :
24+ dotnet-version : 9.0.x
25+ - name : Restore dependencies
26+ run : dotnet restore
27+ - name : Build
28+ run : dotnet build --no-restore -p:PostBuildEvent=
29+ - name : Test
30+ run : dotnet test --no-build --verbosity normal
31+ - name : Clean
32+ run : dotnet clean
33+ - name : Build
34+ if : ${{ github.event_name != 'pull_request' }}
35+ run : dotnet build --no-restore --configuration Release -p:PostBuildEvent=
36+ - name : Publish Windows 64bit
37+ if : ${{ github.event_name != 'pull_request' }}
38+ run : dotnet publish --os win --arch x64 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj
39+ - name : Publish Windows 32bit
40+ if : ${{ github.event_name != 'pull_request' }}
41+ run : dotnet publish --os win --arch x86 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj
42+ - name : Publish Linux 64bit
43+ if : ${{ github.event_name != 'pull_request' }}
44+ run : dotnet publish --os linux --arch x64 -f net9.0 -c Release --self-contained false MSURandomizer/MSURandomizer.csproj
45+ - name : Publish Windows 64bit
46+ if : ${{ github.event_name != 'pull_request' }}
47+ run : dotnet publish -f net9.0
48+ - name : Get version number
49+ if : ${{ github.event_name != 'pull_request' }}
50+ id : version
51+ run : |
52+ $version = (Get-Item "MSURandomizer\bin\Release\net9.0\win-x86\publish\MSURandomizer.exe").VersionInfo.ProductVersion
53+ $version = $version -replace "\+.*", ""
54+ Write-Output "number=$version" >> $env:GITHUB_OUTPUT
55+ shell : pwsh
56+ - name : Building the Windows installer
57+ if : ${{ github.event_name != 'pull_request' }}
58+ run : ' " %programfiles(x86)%/Inno Setup 6/iscc.exe" "setup/MSURandomizer.iss" '
59+ shell : cmd
60+ - name : Copy Nuget Packages
61+ if : ${{ github.event_name != 'pull_request' }}
62+ working-directory : setup
63+ run : " ./CopyNugetPackages.ps1"
64+ shell : pwsh
65+ - name : Building the Linux 64bit package
66+ if : ${{ github.event_name != 'pull_request' }}
67+ working-directory : setup
68+ run : " ./LinuxBuildZipper.ps1"
69+ shell : pwsh
70+ - name : Upload artifact
71+ uses : actions/upload-artifact@v4
72+ if : ${{ github.event_name != 'pull_request' }}
73+ with :
74+ path : " setup/Output/*"
75+ name : MSURandomizer_${{ steps.version.outputs.number }}
0 commit comments