From 7caba4a4bea97b5beca3c54f8bc2642416c3d106 Mon Sep 17 00:00:00 2001 From: Ross Light Date: Mon, 7 Sep 2020 14:01:22 -0700 Subject: [PATCH] release/msi: strip 'v' from versions Updates #48 --- .github/workflows/release.yml | 11 +++-------- release/msi/release.ps1 | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 487dfe5..a93b34e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,17 +64,12 @@ jobs: run: go mod download env: GO111MODULE: on - - name: Build executable - run: |- - release\build.ps1 ` - -version ($Env:GITHUB_REF).trimstart('refs/tags/') ` - -out release\msi\gg.exe - env: - GO111MODULE: on - name: Package release - run: .\release.ps1 -version ($Env:GITHUB_REF).trimstart('refs/tags/') + run: .\release.ps1 -version ($Env:GITHUB_REF).trimstart('refs/tags/v') working-directory: .\release\msi id: package + env: + GO111MODULE: on - name: Upload binary uses: actions/upload-release-asset@v1 env: diff --git a/release/msi/release.ps1 b/release/msi/release.ps1 index def4cab..3989327 100644 --- a/release/msi/release.ps1 +++ b/release/msi/release.ps1 @@ -14,29 +14,28 @@ # # SPDX-License-Identifier: Apache-2.0 -param($version='') +param($version='dev') If ( ! ( Test-Path Env:wix ) ) { Write-Error 'WiX not installed; cannot find %wix%.' exit 1 } -$filename="gg" -If ( $version -ne '' ) { - $filename+="_${version}" -} -$filename+=".msi" - +$filename="gg_${version}_amd64.msi" $wixVersion="0.0.0" -$wixVersionMatch=[regex]::Match($version, '^v([0-9]+\.[0-9]+\.[0-9]+)') +$wixVersionMatch=[regex]::Match($version, '^([0-9]+\.[0-9]+\.[0-9]+)') If ( $wixVersionMatch.success ) { $wixVersion=$wixVersionMatch.captures.groups[1].value -} Elseif ( $version -ne '' ) { +} Elseif ( $version -ne 'dev' ) { Write-Error "Invalid version $version" exit 1 } -& "${env:wix}bin\\candle.exe" ` +..\build.ps1 ` + -version $version ` + -out gg.exe + +& "${env:wix}bin\candle.exe" ` -nologo ` -arch x64 ` "-dGgVersion=$version" ` @@ -45,7 +44,7 @@ If ( $wixVersionMatch.success ) { If ( $LastExitCode -ne 0 ) { exit $LastExitCode } -& "${env:wix}bin\\light.exe" ` +& "${env:wix}bin\light.exe" ` -nologo ` -dcl:high ` -ext WixUIExtension `