Skip to content

Commit e35a6bf

Browse files
fix: handle v-prefixed version in release build
1 parent 5808198 commit e35a6bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ jobs:
4949
}
5050
if (-not [string]::IsNullOrWhiteSpace("${{ inputs.version_number }}")) {
5151
Write-Output "version_number=${{ inputs.version_number }}" >> $env:GITHUB_OUTPUT
52+
} elseif (-not [string]::IsNullOrWhiteSpace("${{ inputs.version }}")) {
53+
$verNum = "${{ inputs.version }}"
54+
if ($verNum.StartsWith("v")) { $verNum = $verNum.Substring(1) }
55+
Write-Output "version_number=$verNum" >> $env:GITHUB_OUTPUT
5256
}
5357
if (-not [string]::IsNullOrWhiteSpace("${{ inputs.notes }}")) {
5458
Write-Output "notes=${{ inputs.notes }}" >> $env:GITHUB_OUTPUT
@@ -392,8 +396,8 @@ jobs:
392396
393397
# Use cmd to call vcvarsall and then cl
394398
$outName = "win-witr-${{ matrix.arch }}.exe"
395-
$ver = "${{ needs.prepare.outputs.version_number }}"
396-
cmd /c "`"$vcvarsPath`" $vcvarsArch && cl /O2 /Ot /GL /std:c++20 /EHsc main.cpp /DUNICODE /D_UNICODE /DVERSION_NUMBER=`"$ver`" /Fe:$outName"
399+
$verTag = "${{ needs.prepare.outputs.version }}"
400+
cmd /c "`"$vcvarsPath`" $vcvarsArch && cl /O2 /Ot /GL /std:c++20 /EHsc main.cpp /DUNICODE /D_UNICODE /DVERSION_NUMBER=`"$verTag`" /Fe:$outName"
397401
if ($LASTEXITCODE -ne 0) {
398402
Write-Host "Build failed with exit code $LASTEXITCODE"
399403
Exit $LASTEXITCODE

0 commit comments

Comments
 (0)