Skip to content

Commit d5f124d

Browse files
authored
Merge pull request #180 from nutdotnet/81-release-building
ClickOnce Build Workflow
2 parents 776f093 + 86c4024 commit d5f124d

File tree

11 files changed

+323
-87
lines changed

11 files changed

+323
-87
lines changed

.github/workflows/build-debug.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: build-debug
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: dev-*
7+
paths:
8+
- '**.vb'
9+
- '**.vbproj'
10+
11+
jobs:
12+
build-debug:
13+
runs-on: windows-latest
14+
steps:
15+
- name: "Get Short SHA"
16+
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 8))" >> $env:GITHUB_ENV
17+
18+
- name: Setup MSBuild
19+
uses: microsoft/setup-msbuild@v2
20+
21+
- name: Checkout Code
22+
uses: actions/checkout@v4
23+
24+
# msbuild cannot handle .vdproj Installer projects, so only build debug for now.
25+
- name: Build solution
26+
run: msbuild -t:build -restore -p:Configuration=Debug WinNUT_V2/WinNUT_V2.sln
27+
28+
- name: Upload Artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: ${{ format('WinNUT-Client-debugbuild-{0}', env.SHORT_SHA) }}
32+
if-no-files-found: error
33+
path: WinNUT_V2/WinNUT-Client/bin/Debug

.github/workflows/build-release.yaml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Build solution in Release mode and submit a GitHub release.
2+
3+
name: build-release
4+
5+
on:
6+
push:
7+
tags: "v*"
8+
9+
env:
10+
# The desired name of the no-install archive to be uploaded along side the installer.
11+
ARCHIVE_NAME: "_WinNUT-Client-NoInstall"
12+
13+
jobs:
14+
build-release:
15+
runs-on: windows-latest
16+
steps:
17+
- name: Setup Git
18+
run: |
19+
git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github
20+
git config --global user.name github-actions
21+
git config --global user.email [email protected]
22+
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Extract version from tag
27+
id: get-ver
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+
37+
- name: Setup MSBuild
38+
uses: microsoft/setup-msbuild@v2
39+
40+
- name: Build solution
41+
working-directory: WinNUT_V2
42+
run: >
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+
49+
- name: Checkout pages branch
50+
uses: actions/checkout@v4
51+
with:
52+
ref: "gh-pages"
53+
path: "gh-pages"
54+
55+
- name: Prep ClickOnce branch and deploy
56+
working-directory: gh-pages
57+
run: |
58+
$outDir = "WinNUT_V2/WinNUT-Client/publish"
59+
Write-Output "Removing previous files..."
60+
if (Test-Path "Application Files") {
61+
Remove-Item -Path "Application Files" -Recurse
62+
}
63+
if (Test-Path "WinNUT-Client.application") {
64+
Remove-Item -Path "WinNUT-Client.application"
65+
}
66+
Write-Output "Copying new files..."
67+
Copy-Item -Path "../$outDir/Application Files","../$outDir/WinNUT-Client.application" -Destination . -Recurse
68+
# Stage and commit.
69+
Write-Output "Staging..."
70+
git add -A
71+
Write-Output "Committing..."
72+
git commit -m "Update to ${{ env.SEMVER }}"
73+
# Push.
74+
git push
75+
76+
- name: Prepare no install archive
77+
run: |
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"
79+
$arc = $arc -replace '\\','/'
80+
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+
86+
- name: Create GitHub release
87+
uses: softprops/action-gh-release@v2
88+
with:
89+
draft: true
90+
fail_on_unmatched_files: true
91+
generate_release_notes: true
92+
files: |
93+
WinNUT_V2/WinNUT-Client/publish/_WinNUT-Client-ClickOnce-Installer.application
94+
${{ env.ARCHIVE_NAME }}
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
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: build-translation
2+
3+
on:
4+
workflow_dispatch:
5+
6+
pull_request:
7+
branches: Dev-2.2
8+
paths:
9+
- "**.xlf"
10+
11+
jobs:
12+
build-translation:
13+
runs-on: windows-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
- name: Install Multilingual App Toolkit extension
18+
uses: microcompiler/install-vsix@db1f973c3d24d1ddc0c38f14d0e1e3a85b2ccb21
19+
with:
20+
packagename: 'dts-publisher.mat2022'
21+
- name: Build solution in Debug configuration
22+
uses: ./.github/actions/build-solution
23+
with:
24+
build-mode: "Debug"
25+
version: "${{ vars.PRERELEASE_VERSION }}.*"

.github/workflows/build-validate.yaml

-53
This file was deleted.

.github/workflows/get-ver.ps1

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Verify valid semver, and provide it along with an AssemblyVersion-compatible string as env vars.
2+
3+
# Set to the value provided by github.ref
4+
param([string]$ghRef)
5+
6+
$semVerRegex = "(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
7+
$matchInfo = [regex]::Match($ghRef, $semVerRegex)
8+
9+
if (!($matchInfo.Success)) {
10+
Write-Host "Could not find valid semver within ref. string. Given: $ghRef"
11+
Exit 1
12+
}
13+
14+
$verRes = "VER={0}.{1}.{2}" -f $matchInfo.Groups["major"], $matchInfo.Groups["minor"], $matchInfo.Groups["patch"]
15+
$semVerRes = "SEMVER=" + $matchInfo.Value
16+
$isPr = "ISPRERELEASE=" + $matchInfo.Groups.ContainsKey("prerelease").ToString().ToLower()
17+
18+
echo $verRes >> $env:GITHUB_OUTPUT
19+
echo $semVerRes >> $env:GITHUB_OUTPUT
20+
echo $isPr >> $env:GITHUB_OUTPUT
21+
22+
Write-Host "Result: $verRes, $semVerRes, $isPr"

changelog.md CHANGELOG.md

+69-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,73 @@
11
## History:
2-
### Further releases
3-
Please see the [releases](https://github.com/nutdotnet/WinNUT-Client/releases) page for more recent releases.
2+
### Pre-Release v2.2.8436
3+
After a longer than expected wait, the next pre-release is out with another set of bugfixes.
4+
5+
## What's Changed
6+
* Data directory location is more consistent depending on how WinNUT is being run (build type and location) by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/62
7+
* Also includes some improvements to the Logger
8+
* WinNUT is more stable when the connection is lost, and the UI will no longer show strange data by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/64
9+
* Define UPS_States values as pow of 2 to fix state change detection by @supersmile2009 in https://github.com/nutdotnet/WinNUT-Client/pull/71
10+
* Fix release build by @supersmile2009 in https://github.com/nutdotnet/WinNUT-Client/pull/72
11+
12+
## New Contributors
13+
* @supersmile2009 made their first contribution in https://github.com/nutdotnet/WinNUT-Client/pull/71
14+
15+
**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8356...v2.2.8436
16+
17+
### Pre-Release v2.2.8356
18+
## What's Changed
19+
* Installer dependency cleanup by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/48
20+
* Logging fixes by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/50
21+
* Fix incorrect windows version detection by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/51
22+
* Fix List_Var_Gui error by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/52
23+
* Upgrade to .Net Framework 4.8 by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/53
24+
* Upgrade unhandled exception handling, cryptography by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/49
25+
* This fixes an error on startup that was affecting many people. Please upgrade to this version if WinNUT was crashing on startup for you.
26+
* Respect Follow FSD setting by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/57
27+
28+
Also fixing the installer per #60
29+
30+
**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8331...v2.2.8356
31+
32+
### Pre-Release v2.2.8331 (Installer quick fix)
33+
Quick fix to remove many dependencies that were added to the installer distribution of WinNUT. Only the installer has changed; please see the last release for the non-installer version.
34+
35+
### Pre-Release v2.2.8328
36+
## Noticeable changes
37+
* Re-enabled the Battery Runtime calculation. Not sure why it was disabled, please report any issues experienced with this. https://github.com/nutdotnet/WinNUT-Client/pull/33
38+
* Finally applied pending de-DE and zh-TW translations to WinNUT https://github.com/nutdotnet/WinNUT-Client/pull/39
39+
* Re-activate stop actions system and extensive core changes including status updates overhaul in https://github.com/nutdotnet/WinNUT-Client/pull/36
40+
* Also fixed resuming WinNUT from a suspended state
41+
* Correct Interval/Delay value in https://github.com/nutdotnet/WinNUT-Client/pull/37
42+
43+
## Minor changes
44+
* Created a build automation workflow so pull requests will have debug builds of WinNUT created and available for download automatically.
45+
* Updated documentation for build & release, and translation procedures.
46+
* Upgraded AGauge .Net Framework to solution's 4.7.2.
47+
* Replaced Win10 static binary references with NuGet package to enable Toast Notifications while still building cross-platform (Win7 and up).
48+
49+
## New Contributors
50+
* @MartinKurtz made their first contribution in https://github.com/nutdotnet/WinNUT-Client/pull/30
51+
52+
**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8303...v2.2.8328
53+
54+
### Version 2.2.8303
55+
Attempting to fix versioning on MSI Installer for future smooth upgrades. No changes in main program since last version.
56+
57+
**NOTE:** You will need to remove the old version (2.2 in Add Remove Programs list) for this and future upgrades to install correctly.
58+
59+
**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8286...v2.2.8303
60+
61+
### Version 2.2.8286
62+
Beta/Prerelease
63+
* Add Translation/zh-TW/zh-TW.csv for Chinese (Traditional) by @yrctw in https://github.com/nutdotnet/WinNUT-Client/pull/23
64+
* Large changes to Socket/UPS, DATA-STALE error handling by @gbakeman in https://github.com/nutdotnet/WinNUT-Client/pull/25
65+
66+
## New Contributors
67+
* @yrctw made their first contribution in https://github.com/nutdotnet/WinNUT-Client/pull/23
68+
69+
**Full Changelog**: https://github.com/nutdotnet/WinNUT-Client/compare/v2.2.8255...v2.2.8286
70+
471

572
### Version 2.2.8255
673
Beta Release

COPYING LICENSE.txt

File renamed without changes.

WinNUT_V2/SharedAssemblyInfo.vb

-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ Imports System.Resources
55
<Assembly: AssemblyProduct("WinNUT Client")>
66
<Assembly: AssemblyCopyright("NUTDotNet contributors © 2019-2024")>
77
<Assembly: AssemblyTrademark("https://github.com/nutdotnet/WinNUT-Client")>
8-
9-
<Assembly: AssemblyVersion("2.3.*")>
108
<Assembly: NeutralResourcesLanguage("en-US")>

0 commit comments

Comments
 (0)