-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Upgrade action versions - Ported over get-ver.ps1 changes from AGauge repository - Release build workflow selects solution configuration based on result from get-ver - Simplified msbuild command
- Loading branch information
Showing
3 changed files
with
47 additions
and
67 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,7 @@ on: | |
|
||
env: | ||
# The desired name of the no-install archive to be uploaded along side the installer. | ||
ARCHIVE_NAME: "winnut-client-noinstall" | ||
VS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise" | ||
ARCHIVE_NAME: "_WinNUT-Client-NoInstall" | ||
|
||
jobs: | ||
build-release: | ||
|
@@ -20,26 +19,39 @@ jobs: | |
git config --global url."https://user:${{ secrets.GITHUB_TOKEN }}@github".insteadOf https://github | ||
git config --global user.name github-actions | ||
git config --global user.email [email protected] | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
# Provide VER and SEMVER env vars. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Extract version from tag | ||
id: get-ver | ||
run: ./.github/workflows/get-ver.ps1 ${{ github.ref }} | ||
|
||
- name: Confirm Build mode | ||
id: build-mode | ||
run: > | ||
if ($${{ steps.get-ver.outputs.ISPRERELEASE }}) | ||
{ echo "BUILD_MODE=PreRelease" >> $env:GITHUB_OUTPUT } | ||
else { echo "BUILD_MODE=Release" >> $env:GITHUB_OUTPUT } | ||
- name: Setup MSBuild | ||
uses: microsoft/setup-msbuild@v1 | ||
uses: microsoft/setup-msbuild@v2 | ||
|
||
- name: Build solution | ||
working-directory: WinNUT_V2 | ||
run: > | ||
msbuild -target:"restore;publish" | ||
-property:Configuration="Release" | ||
-property:Version="${{ env.VER }}" | ||
-property:ApplicationVersion="${{ env.VER }}.0" | ||
-property:PublishDir="./publish" | ||
msbuild -t:"publish" -restore | ||
-p:Configuration="${{ steps.build-mode.outputs.BUILD_MODE }}" | ||
-p:Version="${{ steps.get-ver.outputs.VER }}" | ||
-p:ApplicationVersion="${{ steps.get-ver.outputs.VER }}.0" | ||
-p:PublishDir="./publish" | ||
- name: Checkout pages branch | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "gh-pages" | ||
path: "gh-pages" | ||
|
||
- name: Prep ClickOnce branch and deploy | ||
working-directory: gh-pages | ||
run: | | ||
|
@@ -60,20 +72,28 @@ jobs: | |
git commit -m "Update to ${{ env.SEMVER }}" | ||
# Push. | ||
git push | ||
- name: Prepare no install archive | ||
run: | | ||
$arc = Compress-Archive -PassThru -Path "WinNUT_V2\WinNUT-Client\bin\Release" -DestinationPath "${{ env.ARCHIVE_NAME }}-${{ env.SEMVER }}.zip" | ||
$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" | ||
$arc = $arc -replace '\\','/' | ||
echo "ARCHIVE_NAME=$arc" >> $env:GITHUB_ENV | ||
# Rename the CO bootstrapper file to appear after the MSI once it's uploaded. | ||
- name: HACK - Rename ClickOnce bootstrapper | ||
run: Rename-Item -Path "./WinNUT_V2/WinNUT-Client/publish/WinNUT-Client.application" -NewName "_WinNUT-Client-ClickOnce-Installer.application" | ||
|
||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: true | ||
fail_on_unmatched_files: true | ||
generate_release_notes: true | ||
files: | | ||
WinNUT_V2/WinNUT-Client/publish/WinNUT-Client.application | ||
WinNUT_V2/WinNUT-Client/publish/_WinNUT-Client-ClickOnce-Installer.application | ||
${{ env.ARCHIVE_NAME }} | ||
LICENSE.txt | ||
README.md | ||
CHANGELOG.md | ||
# Leave out other files until we no longer need the MSI be first in the assets list. | ||
# LICENSE.txt | ||
# README.md | ||
# CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters