Skip to content

ci(nightly): move the tag and edit the release in place, instead of delete+recreate - #726

Merged
BenjaminAmos merged 1 commit into
masterfrom
ci/nightly-edit-not-recreate
Aug 9, 2026
Merged

BenjaminAmos merged 1 commit into
masterfrom
ci/nightly-edit-not-recreate

Conversation

@soloturn

@soloturn soloturn commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Retargeting the nightly tag (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) since edit doesn'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 --prerelease being 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

  • YAML validated with yq; both run: blocks syntax-checked with bash -n.
  • Verified gh release edit actually supports a bare --prerelease flag (via gh release edit --help), rather than assuming.
  • Not yet exercised in Actions - needs a push to master or a manual workflow_dispatch to 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 the nightly release/tag already exist from prior runs).

…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
@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 12c3de1d-5742-4676-a74d-9cb35a26b8b1

📥 Commits

Reviewing files that changed from the base of the PR and between e5c73fc and 75dfc77.

📒 Files selected for processing (1)
  • .github/workflows/nightly.yml

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved nightly release updates to preserve the existing release instead of deleting and recreating it.
    • Nightly releases now reliably update their tag, metadata, and assets.
    • Added support for creating the nightly release automatically on its first run.

Walkthrough

The nightly workflow now moves or creates the nightly tag through the GitHub API. It updates an existing release and replaces its assets, or creates the release when it does not exist.

Changes

Nightly release publication

Layer / File(s) Summary
Retarget tag and publish release
.github/workflows/nightly.yml
The publish job retargets or creates the nightly tag, computes release metadata, and updates or creates the nightly release with current artifacts.

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
Loading

Possibly related PRs

Poem

A rabbit saw the nightly tag hop,
It moved to the newest commit on top.
Old assets left, new ones flew,
The release was refreshed anew.
“Create it once, then update with care!”
Said the rabbit, twitching its ear.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the workflow changes, implementation details, notification behavior, and testing status.
Title check ✅ Passed The title clearly summarizes the main workflow change: moving the tag and editing the release instead of recreating it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/nightly-edit-not-recreate

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@BenjaminAmos
BenjaminAmos merged commit 2da4e3f into master Aug 9, 2026
11 checks passed
@BenjaminAmos
BenjaminAmos deleted the ci/nightly-edit-not-recreate branch August 9, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants