ci(release): gate by release existence, not tag
All checks were successful
Desktop CI / tests (push) Successful in 13s
Desktop Release / release (push) Successful in 1m55s

- initialize CONTINUE=true at flow start

- keep stop condition only when release with same tag already exists
This commit is contained in:
2026-02-15 21:11:18 +03:00
parent 61948a51c6
commit cf6d6bcbd0

View File

@@ -47,26 +47,15 @@ jobs:
[System.IO.File]::AppendAllText($env:GITHUB_OUTPUT, "version=$version`n", $utf8NoBom)
Write-Host "Detected version: $version"
- name: Stop if version already released
id: stop
- name: Initialize release flow
id: flow_init
shell: powershell
run: |
$version = "${{ steps.extract_version.outputs.version }}"
$tag = "v$version"
$tagLine = (git ls-remote --tags origin "refs/tags/$tag" | Select-Object -First 1)
$tagExists = -not [string]::IsNullOrWhiteSpace($tagLine)
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
if ($tagExists) {
Write-Host "Version $tag already released, stopping job."
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=false`n", $utf8NoBom)
} else {
Write-Host "Version $tag not released yet, continuing workflow..."
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=true`n", $utf8NoBom)
}
[System.IO.File]::AppendAllText($env:GITHUB_ENV, "CONTINUE=true`n", $utf8NoBom)
exit 0
- name: Stop if release already exists
if: env.CONTINUE == 'true'
shell: powershell
run: |
$version = "${{ steps.extract_version.outputs.version }}"