Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/scripts/bump-version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,19 @@ function Set-Part([string] $name, [int] $value) {
}

function Test-Released([string] $version) {
foreach ($tag in @("v$version", $version)) {
& git rev-parse -q --verify "refs/tags/$tag" *> $null
if ($LASTEXITCODE -eq 0) { return $true }
try {
foreach ($tag in @("v$version", $version)) {
& git rev-parse -q --verify "refs/tags/$tag" *> $null
if ($LASTEXITCODE -eq 0) { return $true }
}
return $false
}
finally {
# 'git rev-parse --verify' exits 1 when a tag does not exist, which is the
# expected answer here. Don't let that leak out as the step's exit code:
# GitHub Actions' pwsh wrapper ends every step with 'exit $LASTEXITCODE'.
$global:LASTEXITCODE = 0
}
return $false
}

$major = Get-Part 'RELEASE_MAJOR'
Expand Down Expand Up @@ -94,3 +102,5 @@ if ($env:GITHUB_OUTPUT) {
"changed=$($changed.ToString().ToLowerInvariant())"
) | Add-Content -Path $env:GITHUB_OUTPUT
}

exit 0
1 change: 1 addition & 0 deletions .github/scripts/verify-package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ if ($failures.Count -gt 0) {
throw "Package verification failed with $($failures.Count) problem(s)."
}
Write-Host "Package $nupkgPath verified."
exit 0
Loading