8
8
9
9
env :
10
10
# The desired name of the no-install archive to be uploaded along side the installer.
11
- ARCHIVE_NAME : " winnut-client"
11
+ ARCHIVE_NAME : " winnut-client-noinstall "
12
12
VS_PATH : " C:/Program Files/Microsoft Visual Studio/2022/Enterprise"
13
13
14
14
jobs :
15
15
build-release :
16
16
runs-on : windows-latest
17
17
steps :
18
+ - name : Setup Git
19
+ run : |
20
+ git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github
21
+ git config --global user.name github-actions
22
+ git config --global user.email github-actions@github.com
18
23
- name : Checkout code
19
24
uses : actions/checkout@v3
20
25
# Provide VER and SEMVER env vars.
21
26
- name : Extract version from tag
22
27
run : ./.github/workflows/get-ver.ps1 ${{ github.ref }}
23
- - name : Build solution in Release configuration
24
- uses : ./.github/actions/build-solution
28
+ - name : Setup MSBuild
29
+ uses : microsoft/setup-msbuild@v1
30
+ - name : Build solution
31
+ working-directory : WinNUT_V2
32
+ 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"
38
+ - name : Checkout pages branch
39
+ uses : actions/checkout@v3
25
40
with :
26
- build-mode : " Release"
27
- version : " ${{ env.VER }}"
41
+ ref : " gh-pages"
42
+ path : " gh-pages"
43
+ - name : Prep ClickOnce branch and deploy
44
+ working-directory : gh-pages
45
+ run : |
46
+ $outDir = "WinNUT_V2/WinNUT-Client/publish"
47
+ Write-Output "Removing previous files..."
48
+ if (Test-Path "Application Files") {
49
+ Remove-Item -Path "Application Files" -Recurse
50
+ }
51
+ if (Test-Path "WinNUT-Client.application") {
52
+ Remove-Item -Path "WinNUT-Client.application"
53
+ }
54
+ Write-Output "Copying new files..."
55
+ Copy-Item -Path "../$outDir/Application Files","../$outDir/WinNUT-Client.application" -Destination . -Recurse
56
+ # Stage and commit.
57
+ Write-Output "Staging..."
58
+ git add -A
59
+ Write-Output "Committing..."
60
+ git commit -m "Update to ${{ env.SEMVER }}"
61
+ # Push.
62
+ git push
28
63
- name : Prepare no install archive
29
64
run : |
30
- $arc = Compress-Archive -PassThru -Path "WinNUT_V2\WinNUT-Client\bin\Release" -DestinationPath "${{ env.ARCHIVE_NAME }}-v${{ env.SEMVER }}.zip"
65
+ $arc = Compress-Archive -PassThru -Path "WinNUT_V2\WinNUT-Client\bin\Release" -DestinationPath "${{ env.ARCHIVE_NAME }}-${{ env.SEMVER }}.zip"
66
+ $arc = $arc -replace '\\','/'
31
67
echo "ARCHIVE_NAME=$arc" >> $env:GITHUB_ENV
32
- # https://stackoverflow.com/questions/8648428/an-error-occurred-while-validating-hresult-8000000a
33
- - name : Fix 'out of process' build error
34
- working-directory : ${{ env.VS_PATH }}
35
- run : Start-Process -Wait -NoNewWindow "${{ env.VS_PATH }}\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild\DisableOutOfProcBuild.exe"
36
- # Since MSBuild won't build the Setup project, we need to call devenv directly.
37
- - name : Build Setup Project
38
- run : Start-Process -Wait -NoNewWindow "${{ env.VS_PATH }}\common7\ide\devenv.com" -ArgumentList "WinNUT_V2\WinNUT_V2.sln /Build Release /Project Setup\Setup.vdproj"
39
- - name : Create prerelease
68
+ - name : Create GitHub release
40
69
uses : softprops/action-gh-release@v1
41
70
with :
42
71
draft : true
43
72
fail_on_unmatched_files : true
44
73
generate_release_notes : true
45
74
files : |
46
- WinNUT_V2/Setup/Release /WinNUT-Setup.msi
75
+ WinNUT_V2/WinNUT-Client/publish /WinNUT-Client.application
47
76
${{ env.ARCHIVE_NAME }}
48
77
LICENSE.txt
49
78
README.md
50
- CHANGELOG.md
51
- # - name: Create prerelease
52
- # uses: "marvinpinto/action-automatic-releases@v1.2.1"
53
- # with:
54
- # repo_token: "${{ secrets.GITHUB_TOKEN }}"
55
- # draft: true # Release as draft until I'm more confident
56
- # prerelease: true
57
- # files: |
58
- # WinNUT_V2\Setup\Release\WinNUT-Setup.msi
59
- # ${{ env.ARCHIVE_NAME }}.zip
60
- # LICENSE.txt
61
- # README.md
62
- # CHANGELOG.md
79
+ CHANGELOG.md
0 commit comments