Remove action, release build tweaks #21
Workflow file for this run
This file contains hidden or 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
# Build solution in Release mode and submit a GitHub release. | |
name: build-release | |
on: | |
push: | |
tags: "v*" | |
env: | |
# The desired name of the no-install archive to be uploaded along side the installer. | |
ARCHIVE_NAME: "winnut-client-noinstall" | |
jobs: | |
build-release: | |
runs-on: windows-latest | |
steps: | |
- name: Setup Git | |
run: | | |
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 github-actions@github.com | |
- name: Checkout code | |
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@v2 | |
- name: Build solution | |
working-directory: WinNUT_V2 | |
run: > | |
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" | |
# -property:Configuration="Release" | |
# -property:Version="${{ env.VER }}" | |
# -property:PublishDir="./publish" | |
- name: Checkout pages branch | |
uses: actions/checkout@v3 | |
with: | |
ref: "gh-pages" | |
path: "gh-pages" | |
- name: Prep ClickOnce branch and deploy | |
working-directory: gh-pages | |
run: | | |
$outDir = "WinNUT_V2/WinNUT-Client/publish" | |
Write-Output "Removing previous files..." | |
if (Test-Path "Application Files") { | |
Remove-Item -Path "Application Files" -Recurse | |
} | |
if (Test-Path "WinNUT-Client.application") { | |
Remove-Item -Path "WinNUT-Client.application" | |
} | |
Write-Output "Copying new files..." | |
Copy-Item -Path "../$outDir/Application Files","../$outDir/WinNUT-Client.application" -Destination . -Recurse | |
# Stage and commit. | |
Write-Output "Staging..." | |
git add -A | |
Write-Output "Committing..." | |
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\${{ 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 | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
fail_on_unmatched_files: true | |
generate_release_notes: true | |
files: | | |
WinNUT_V2/WinNUT-Client/publish/WinNUT-Client.application | |
${{ env.ARCHIVE_NAME }} | |
LICENSE.txt | |
README.md | |
CHANGELOG.md |