update ci workflow
publish / publish-tauri (, windows-latest) (release) Failing after 2m6s

This commit is contained in:
Christoph Brandau
2026-06-30 14:54:06 +02:00
parent 7b363fd4a6
commit 38f97713c6
+17 -10
View File
@@ -89,15 +89,15 @@ jobs:
git commit -m 'Update version to ${{ github.ref_name }}'
if ($LASTEXITCODE -ne 0) {
Write-Host 'No changes to commit.'
# Version files already match the tag -> nothing to push, succeed quietly.
Write-Host 'No version changes to commit; skipping push.'
exit 0
}
# Get current branch; if detached, resolve to a remote branch that contains this commit
$branch = (git rev-parse --abbrev-ref HEAD).Trim()
if ($branch -eq 'HEAD' -or [string]::IsNullOrEmpty($branch)) {
# If target_commitish is a branch, use it; if it's a SHA, find a branch that contains it
$candidate = '${{ github.event.release.target_commitish }}'
if ($candidate -match '^[0-9a-f]{40}$') {
# The release build runs in detached HEAD on the tag. Resolve the branch
# that should receive the version bump.
$branch = '${{ github.event.release.target_commitish }}'
if ([string]::IsNullOrEmpty($branch) -or $branch -match '^[0-9a-f]{40}$') {
$branch = (
git branch -r --contains $env:GITHUB_SHA |
ForEach-Object { $_.Trim() } |
@@ -105,9 +105,6 @@ jobs:
ForEach-Object { $_ -replace '^(?:remotes/)?[^/]+/', '' } |
Select-Object -First 1
)
} else {
$branch = $candidate
}
}
if ([string]::IsNullOrEmpty($branch)) {
@@ -116,6 +113,16 @@ jobs:
exit 1
}
# The tag may be behind the branch tip. Replay the bump commit on top of
# the current remote branch so the push is a clean fast-forward.
git fetch origin $branch
git rebase "origin/$branch"
if ($LASTEXITCODE -ne 0) {
git rebase --abort
Write-Host "Rebase onto origin/$branch failed."
exit 1
}
git push origin "HEAD:refs/heads/$branch"
- name: Build Tauri App