fix(ci): derive publish channel from trigger to end 409 race #21
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
The three binary build workflows (
build-binary.ymlLinux glibc,build-binary-static.ymlstatic musl,build-binary-windows.ymlWindows) each trigger on a push to BOTHbranches: [main]andtags: [v*]. A release commit is simultaneously a push to main and the v* tag push, so both events fire. Each run resolved its 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<version>generic-package file, producing intermittent409 package file already existsand red release CI. Tracked as GOV-14; same failure class as CLAUDE-122 / GOV-13.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 immutable<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 is the same minimal trigger-derived change proven in CI on the monkey repo (PR #51); the full forgejo-cli--modeget-tags rewrite is intentionally not introduced here, andoci-build/get-tags.nuis left in place and untouched.Files changed
.forgejo/workflows/build-binary.yml.forgejo/workflows/build-binary-static.yml.forgejo/workflows/build-binary-windows.ymlEach "Get artifact tags" step swaps the
^nu oci-build/get-tags.nu --joinedcall for trigger-derived logic usinggithub.ref_type/github.ref_name. No downstream publish/print step in these workflows had a release-only-channel conditional, so the resulting channels are exactly<version>on a tag push andlateston a main push. All other behavior (build, sha256 sidecar, DELETE-then-PUT publish, printed URLs) is unchanged.Verification
just pre-commitpasses locally (fmt + clippy + build + tests, 41 passed). Change is YAML-only; no Rust touched.#GOV-14