ci(nightly): move the tag and edit the release in place, instead of delete+recreate - #726
Conversation
…elete+recreate Retargeting the nightly tag (via the Git Data API - no checkout needed) is what actually moves the release, since a release points at whatever commit its tag currently resolves to, not a fixed SHA recorded on the release object. Editing the release in place then just refreshes title/notes; assets are swapped explicitly (delete what's there, upload this run's builds) since edit doesn't touch them and filenames embed the commit hash, so old ones are never overwritten by new uploads. Besides being simpler than delete+recreate, this means no new 'release published' notification goes out on every push to master: a bare tag move isn't a notified event, and editing an already-published release doesn't re-fire its original publish notification. (The prior delete+recreate approach relied on --prerelease being excluded from most watchers' default notification preferences instead.) Also drops the full commit SHA from the release title - a short hash (7 chars) is enough there; the full SHA stays in the notes and in every asset's own filename. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3dYofgD6GW7V21k6Mzfud
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe nightly workflow now moves or creates the ChangesNightly release publication
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant NightlyPublishJob
participant GitHubAPI
participant NightlyArtifacts
NightlyPublishJob->>GitHubAPI: Create or force-update nightly tag
NightlyPublishJob->>GitHubAPI: Update or create nightly release
GitHubAPI->>NightlyArtifacts: Delete old release assets
NightlyPublishJob->>GitHubAPI: Upload current artifacts
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Retargeting the
nightlytag (via the Git Data API - no checkout needed in this job) is what actually moves the release, since a release points at whatever commit its tag currently resolves to, not a fixed SHA recorded on the release object. Editing the release in place then just refreshes title/notes; assets are swapped explicitly (delete what's there, upload this run's builds) sinceeditdoesn't touch assets, and filenames embed the commit hash so old ones are never overwritten by new uploads.Besides being simpler than delete+recreate, this means no new "release published" notification goes out on every push to master: a bare tag move isn't a notified event, and editing an already-published release doesn't re-fire its original publish notification. (The prior delete+recreate approach relied on
--prereleasebeing excluded from most watchers' default notification preferences instead - this drops that reliance.)Also drops the full commit SHA from the release title - a short hash (7 chars) is enough there; the full SHA stays in the notes and in every asset's own filename.
Test plan
yq; bothrun:blocks syntax-checked withbash -n.gh release editactually supports a bare--prereleaseflag (viagh release edit --help), rather than assuming.workflow_dispatchto confirm the full move-tag -> edit-release -> swap-assets chain end-to-end (including the very-first-run fallback path, though that's already covered since thenightlyrelease/tag already exist from prior runs).