Skip to content

Commit 149cdf9

Browse files
committed
Updating release workflow for ClickOnce
- Release workflow uses ClickOnce deployments and should upload output accordingly. - Modified client project file to also use this infrastructure, and it should also be automatically checking for updates. - Troubleshooting issue with action-gh-release finding the no install archive.
1 parent 466c390 commit 149cdf9

File tree

2 files changed

+52
-34
lines changed

2 files changed

+52
-34
lines changed

.github/workflows/build-release.yaml

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,72 @@ on:
88

99
env:
1010
# 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"
1212
VS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise"
1313

1414
jobs:
1515
build-release:
1616
runs-on: windows-latest
1717
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
1823
- name: Checkout code
1924
uses: actions/checkout@v3
2025
# Provide VER and SEMVER env vars.
2126
- name: Extract version from tag
2227
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
2540
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
2863
- name: Prepare no install archive
2964
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 '\\','/'
3167
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
4069
uses: softprops/action-gh-release@v1
4170
with:
4271
draft: true
4372
fail_on_unmatched_files: true
4473
generate_release_notes: true
4574
files: |
46-
WinNUT_V2/Setup/Release/WinNUT-Setup.msi
75+
WinNUT_V2/WinNUT-Client/publish/WinNUT-Client.application
4776
${{ env.ARCHIVE_NAME }}
4877
LICENSE.txt
4978
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

WinNUT_V2/WinNUT-Client/WinNUT-client.vbproj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@
1212
<FileAlignment>512</FileAlignment>
1313
<MyType>WindowsForms</MyType>
1414
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
15-
<IsWebBootstrapper>false</IsWebBootstrapper>
15+
<IsWebBootstrapper>true</IsWebBootstrapper>
1616
<TargetFrameworkProfile />
1717
<PublishUrl>publish\</PublishUrl>
1818
<Install>true</Install>
19-
<InstallFrom>Disk</InstallFrom>
20-
<UpdateEnabled>false</UpdateEnabled>
21-
<UpdateMode>Foreground</UpdateMode>
22-
<UpdateInterval>7</UpdateInterval>
19+
<InstallFrom>Web</InstallFrom>
20+
<UpdateEnabled>true</UpdateEnabled>
21+
<UpdateMode>Background</UpdateMode>
22+
<UpdateInterval>1</UpdateInterval>
2323
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
24-
<UpdatePeriodically>false</UpdatePeriodically>
24+
<UpdatePeriodically>true</UpdatePeriodically>
2525
<UpdateRequired>false</UpdateRequired>
2626
<MapFileExtensions>true</MapFileExtensions>
27+
<InstallUrl>https://nutdotnet.github.io/WinNUT-Client/</InstallUrl>
2728
<SupportUrl>https://github.com/nutdotnet/WinNUT-Client/issues</SupportUrl>
2829
<ProductName>WinNUT</ProductName>
2930
<PublisherName>NUTDotNet</PublisherName>

0 commit comments

Comments
 (0)