fix(ci): derive publish channel from trigger to end 409 race #74
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GOV-14-trigger-derived-publish-channels"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Each build workflow (
build-linux.yml,build-windows.yml) triggers onpushto bothbranches: [main]andtags: [v*]. A release commit is simultaneously a push to main and thev*tag push, so both events fire. Both previously resolved the publish tag set fromgit describeviaoci-build/get-tags.nu --joined, which on a tagged commit yields[<version>, latest]for BOTH events. The two runs then raced to DELETE-then-PUT the same immutable generic-package file at the<version>channel, producing intermittent409 package file already existsand red release CI (GOV-13 / CLAUDE-122).Fix
Resolve the publish channel from the workflow trigger instead of
git describe, so the two events publish disjoint channels: a tag push (github.ref_type == 'tag') publishes the<version>channel; a push to main publishes onlylatest. This removes the concurrent writer on the immutable<version>file.lateststill tracks the release commit because the tag sits on the same SHA pushed to main. This mirrors the change proven in CI on themonkeyrepo (PR #51).The downstream publish and print steps already loop over the comma-split
tagsoutput and append no release-only channels of their own, so they needed no change. Neither workflow had release-only channel logic to preserve, so this is the minimal surgical edit (no get-tags--moderewrite).Files
.forgejo/workflows/build-linux.yml: trigger-derived channel in theGet tagsstep..forgejo/workflows/build-windows.yml: same edit, adapted to theyt-windows-x86_64.exeartifact (publish step unchanged).Refs
GOV-14, GOV-13, CLAUDE-122.