9
9
env :
10
10
# The desired name of the no-install archive to be uploaded along side the installer.
11
11
ARCHIVE_NAME : " winnut-client-noinstall"
12
- VS_PATH : " C:/Program Files/Microsoft Visual Studio/2022/Enterprise"
13
12
14
13
jobs :
15
14
build-release :
@@ -20,26 +19,42 @@ jobs:
20
19
git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github
21
20
git config --global user.name github-actions
22
21
git config --global user.email github-actions@github.com
22
+
23
23
- name : Checkout code
24
- uses : actions/checkout@v3
25
- # Provide VER and SEMVER env vars.
24
+ uses : actions/checkout@v4
25
+
26
26
- name : Extract version from tag
27
+ id : get-ver
27
28
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
+
28
37
- name : Setup MSBuild
29
- uses : microsoft/setup-msbuild@v1
38
+ uses : microsoft/setup-msbuild@v2
39
+
30
40
- name : Build solution
31
41
working-directory : WinNUT_V2
32
42
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
+ # -property:Configuration="Release"
49
+ # -property:Version="${{ env.VER }}"
50
+ # -property:PublishDir="./publish"
51
+
38
52
- name : Checkout pages branch
39
53
uses : actions/checkout@v3
40
54
with :
41
55
ref : " gh-pages"
42
56
path : " gh-pages"
57
+
43
58
- name : Prep ClickOnce branch and deploy
44
59
working-directory : gh-pages
45
60
run : |
@@ -60,11 +75,13 @@ jobs:
60
75
git commit -m "Update to ${{ env.SEMVER }}"
61
76
# Push.
62
77
git push
78
+
63
79
- name : Prepare no install archive
64
80
run : |
65
- $arc = Compress-Archive -PassThru -Path "WinNUT_V2\WinNUT-Client\bin\Release " -DestinationPath "${{ env.ARCHIVE_NAME }}-${{ env .SEMVER }}.zip"
81
+ $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"
66
82
$arc = $arc -replace '\\','/'
67
83
echo "ARCHIVE_NAME=$arc" >> $env:GITHUB_ENV
84
+
68
85
- name : Create GitHub release
69
86
uses : softprops/action-gh-release@v1
70
87
with :
0 commit comments