mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
Fix GitHub publish when release tag does not exist yet.
Some checks failed
Release Windows / build (push) Has been cancelled
Some checks failed
Release Windows / build (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
f19840ac7e
commit
d150a060f2
1 changed files with 6 additions and 1 deletions
|
|
@ -73,8 +73,13 @@ if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-Location $repo
|
Set-Location $repo
|
||||||
|
# gh writes "release not found" to stderr; keep Stop for the rest of the script.
|
||||||
|
$prevEap = $ErrorActionPreference
|
||||||
|
$ErrorActionPreference = "Continue"
|
||||||
$existing = gh release view $tag 2>$null
|
$existing = gh release view $tag 2>$null
|
||||||
if ($LASTEXITCODE -eq 0) {
|
$viewCode = $LASTEXITCODE
|
||||||
|
$ErrorActionPreference = $prevEap
|
||||||
|
if ($viewCode -eq 0) {
|
||||||
Write-Host "==> Release $tag exists; uploading assets"
|
Write-Host "==> Release $tag exists; uploading assets"
|
||||||
gh release upload $tag $zip --clobber
|
gh release upload $tag $zip --clobber
|
||||||
if (Test-Path $setup) {
|
if (Test-Path $setup) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue