88
99env :
1010 # The desired name of the no-install archive to be uploaded along side the installer.
11- ARCHIVE_NAME : " winnut-client-noinstall"
12- VS_PATH : " C:/Program Files/Microsoft Visual Studio/2022/Enterprise"
11+ ARCHIVE_NAME : " _WinNUT-Client-NoInstall"
1312
1413jobs :
1514 build-release :
@@ -20,26 +19,39 @@ jobs:
2019 git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github
2120 git config --global user.name github-actions
2221 git config --global user.email [email protected] 22+
2323 - name : Checkout code
24- uses : actions/checkout@v3
25- # Provide VER and SEMVER env vars.
24+ uses : actions/checkout@v4
25+
2626 - name : Extract version from tag
27+ id : get-ver
2728 run : ./.github/workflows/get-ver.ps1 ${{ github.ref }}
29+
30+ - name : Confirm Build mode
31+ id : build-mode
32+ run : >
33+ if ($${{ steps.get-ver.outputs.ISPRERELEASE }})
34+ { echo "BUILD_MODE=PreRelease" >> $env:GITHUB_OUTPUT }
35+ else { echo "BUILD_MODE=Release" >> $env:GITHUB_OUTPUT }
36+
2837 - name : Setup MSBuild
29- uses : microsoft/setup-msbuild@v1
38+ uses : microsoft/setup-msbuild@v2
39+
3040 - name : Build solution
3141 working-directory : WinNUT_V2
3242 run : >
33- msbuild -target:"restore;publish"
34- -property:Configuration="Release"
35- -property:Version="${{ env.VER }}"
36- -property:ApplicationVersion="${{ env.VER }}.0"
37- -property:PublishDir="./publish"
43+ msbuild -t:"publish" -restore
44+ -p:Configuration="${{ steps.build-mode.outputs.BUILD_MODE }}"
45+ -p:Version="${{ steps.get-ver.outputs.VER }}"
46+ -p:ApplicationVersion="${{ steps.get-ver.outputs.VER }}.0"
47+ -p:PublishDir="./publish"
48+
3849 - name : Checkout pages branch
39- uses : actions/checkout@v3
50+ uses : actions/checkout@v4
4051 with :
4152 ref : " gh-pages"
4253 path : " gh-pages"
54+
4355 - name : Prep ClickOnce branch and deploy
4456 working-directory : gh-pages
4557 run : |
@@ -60,20 +72,28 @@ jobs:
6072 git commit -m "Update to ${{ env.SEMVER }}"
6173 # Push.
6274 git push
75+
6376 - name : Prepare no install archive
6477 run : |
65- $arc = Compress-Archive -PassThru -Path "WinNUT_V2\WinNUT-Client\bin\Release " -DestinationPath "${{ env.ARCHIVE_NAME }}-${{ env .SEMVER }}.zip"
78+ $arc = Compress-Archive -PassThru -Path "WinNUT_V2\WinNUT-Client\bin\${{ steps.build-mode.outputs.BUILD_MODE }} " -DestinationPath "${{ env.ARCHIVE_NAME }}-${{ steps.get-ver.outputs .SEMVER }}.zip"
6679 $arc = $arc -replace '\\','/'
6780 echo "ARCHIVE_NAME=$arc" >> $env:GITHUB_ENV
81+
82+ # Rename the CO bootstrapper file to appear after the MSI once it's uploaded.
83+ - name : HACK - Rename ClickOnce bootstrapper
84+ run : Rename-Item -Path "./WinNUT_V2/WinNUT-Client/publish/WinNUT-Client.application" -NewName "_WinNUT-Client-ClickOnce-Installer.application"
85+
6886 - name : Create GitHub release
69- uses : softprops/action-gh-release@v1
87+ uses : softprops/action-gh-release@v2
7088 with :
7189 draft : true
7290 fail_on_unmatched_files : true
7391 generate_release_notes : true
7492 files : |
75- WinNUT_V2/WinNUT-Client/publish/WinNUT -Client.application
93+ WinNUT_V2/WinNUT-Client/publish/_WinNUT -Client-ClickOnce-Installer .application
7694 ${{ env.ARCHIVE_NAME }}
77- LICENSE.txt
78- README.md
79- CHANGELOG.md
95+
96+ # Leave out other files until we no longer need the MSI be first in the assets list.
97+ # LICENSE.txt
98+ # README.md
99+ # CHANGELOG.md
0 commit comments