ci: workflow handle carrying major tag forth#13
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the release GitHub Actions workflow to expose the release action’s outputs and add a post-release step that maintains a floating major version tag (e.g., v1) pointing at the latest released version tag.
Changes:
- Assign an
id: releaseto the local release action step to accesssteps.release.outputs.*. - Add a step that extracts the major (
vN) from the created tag and force-updates/pushes the major tag.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if: steps.release.outputs.tag | ||
| run: | | ||
| major=$(echo "${{ steps.release.outputs.tag }}" | grep -oE '^v[0-9]+') | ||
| git tag -f "$major" "${{ steps.release.outputs.tag }}" |
There was a problem hiding this comment.
steps.release.outputs.tag is created as an annotated tag (see scripts/finalize-release.sh), so git tag -f "$major" "${{ steps.release.outputs.tag }}" will make the floating major tag point to the tag object rather than the underlying commit (a tag-of-a-tag). This can confuse tooling that expects the ref to resolve directly to a commit; peel the tag to its commit (e.g., dereference to the tagged commit) before retagging.
| git tag -f "$major" "${{ steps.release.outputs.tag }}" | |
| git tag -f "$major" "${{ steps.release.outputs.tag }}^{commit}" |
| run: | | ||
| major=$(echo "${{ steps.release.outputs.tag }}" | grep -oE '^v[0-9]+') | ||
| git tag -f "$major" "${{ steps.release.outputs.tag }}" | ||
| git push origin "$major" --force |
There was a problem hiding this comment.
git push origin "$major" --force can race if two release workflows run close together (e.g., multiple PRs merged in quick succession for the same major), potentially moving the floating major tag backwards. Consider adding a concurrency group for this workflow/job (or otherwise ensuring only one run can update the major tag at a time) to avoid non-deterministic tag state.
No description provided.