Fix: обработка stderr от git push в release.ps1

This commit is contained in:
Dmitriy Fofanov
2026-02-23 22:29:32 +03:00
parent 470c8493bd
commit 7e19dea716
+11 -4
View File
@@ -61,8 +61,11 @@ $env:GOOS = ''
$env:GOARCH = ''
Remove-Item Env:GOARM, Env:GOMIPS -ErrorAction SilentlyContinue
$ErrorActionPreference = "Continue"
& make build-all VERSION=$Version
if ($LASTEXITCODE -ne 0) {
$buildExit = $LASTEXITCODE
$ErrorActionPreference = "Stop"
if ($buildExit -ne 0) {
Write-Host "!!! Ошибка компиляции." -ForegroundColor Red
exit 1
}
@@ -112,8 +115,10 @@ if ($existingTag) {
} else {
git tag -a $tag -m "Release $tag"
}
git push origin $tag 2>$null
git push origin master 2>$null
$ErrorActionPreference = "Continue"
git push origin $tag 2>&1 | Out-Null
git push origin master 2>&1 | Out-Null
$ErrorActionPreference = "Stop"
# ── Проверка токена ───────────────────────────────────────────────────────────
@@ -136,7 +141,9 @@ Write-Host ">>> [5/6] Создание релиза в Gitea..." -ForegroundColo
$commit = git rev-parse HEAD
$date = Get-Date -Format 'dd.MM.yyyy HH:mm UTC'
$prevTag = ''
try { $prevTag = git describe --tags --abbrev=0 "$tag^" 2>$null } catch {}
$ErrorActionPreference = "Continue"
try { $prevTag = git describe --tags --abbrev=0 "$tag^" 2>&1 | Where-Object { $_ -is [string] } } catch {}
$ErrorActionPreference = "Stop"
$rawLog = @()
if ($prevTag) {