Automate releases via PR + GitHub Release#6
Draft
fnando wants to merge 16 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces the prior tag-push-driven release mechanism with a PR-reviewed, workflow-driven release flow: a dispatchable release workflow stages builds.json changes into a release PR, and publishing a GitHub Release triggers publish to build/push images and enrich the release.
Changes:
- Add
scripts/release-prepare.shto stage/updatebuilds.json, resolve refs/digests, detect no-op refreshes, and pick the next release tag (v<cli>/v<cli>-N). - Add
.github/workflows/release.ymlto create a release branch + PR from a workflow_dispatch input. - Update
.github/workflows/publish.ymlto trigger onrelease: published, parse refresh tags, and skip already-published rows with warnings while still emitting metadata.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/release-prepare.sh |
New staging script for release/refresh runs: rust selection, builds.json edits, digest/ref resolution, and release tag selection. |
RELEASE.md |
Rewritten maintainer documentation for the PR + GitHub Release-driven flow and refresh tag scheme. |
README.md |
Adds a “Releasing” pointer to RELEASE.md. |
.github/workflows/release.yml |
New dispatch workflow that runs release-prepare.sh, pushes release/<tag>, and opens a PR. |
.github/workflows/publish.yml |
Switch publish trigger to release: published, support v<version>-N tags, and implement skip-with-warning behavior for immutable tags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the previous "push a
v*tag" trigger with a PR-driven release flow. A newreleaseworkflow opens a release PR for review; merging plus publishing a GitHub Release fires the publish workflow. Refreshing an already-released cli with newer rust versions uses the same flow with av<cli>-Niteration suffix on the tag.scripts/release-prepare.sh— given a stellar-cli version, detects new vs refresh mode, auto-picks the last two minor stable Rusts at their latest patch fromrust-lang/rust(override via--rust-versions), updatesbuilds.jsonaccordingly, resolves the cli ref + rust digests, validates, and prints the chosen GitHub Release tag (v<cli>for new,v<cli>-<N>for refresh). Errors loudly when a refresh would be a no-op (no new Rusts available + nothing else changed).scripts/release-body.sh— composes the markdown body for a GitHub Release from the per-arch metadata files uploaded by the publish workflow.scripts/verify-image.sh— wrapsgh attestation verifyfor both predicate types against a digest-pinned image (consumer-facing)..github/workflows/release.yml—workflow_dispatchwith a requiredstellar_cli_versioninput. Stages the changes viarelease-prepare.sh, captures the picked release tag, pushes arelease/<tag>branch, opens a PR titled "Release stellar-cli " or "Refresh stellar-cli ()" with a pre-filledreleases/new?tag=<tag>link. SHA-pinned actions..github/workflows/publish.yml— switched frompush: tags: v*torelease: types: [published]. Parses bothv<version>andv<version>-<N>tags to derive the cli version. Existence check changed from fail to skip with aRELEASE.md— rewritten to describe the workflow-driven flow, the-Nrefresh tag scheme, the skip-with-warning behaviour, and the manual / local-prepare path.Why
Three problems the previous design had:
git push origin v26.0.0was a single-user low-ceremony action with no PR review of the release contents. The new flow puts a reviewed PR between the maintainer's intent and the publish.v26.0.0,v26.0.0-1,v26.0.0-2, ...) makes every release page a fresh artifact — no append/overwrite dance, historical pages stay intact as snapshots.Notable choices
v<cli>for new releases,v<cli>-<N>for refreshes. The-Nis our refresh iteration, not stellar-cli's patch versions. Docker image tags (:26.0.0-rust1.94.0-amd64) are unaffected — they remain pinned by cli + rust + arch.builds.json(auto-pick matches the current declared state),release-prepare.shexits non-zero with a clear message before pushing an empty commit.::warning::annotations and a step-summary block, so the run page surfaces what was skipped without dressing it up as a failure.append_body: trueon the release update. Each release tag is fresh, so there's no body to overwrite — the workflow's structural section appends below whatever notes the maintainer wrote when they clicked "Publish release".Depends on
#5 (
repro) — this branch is based on it. Base auto-updates tomainas the upstream chain merges.Verification
shellcheckclean on all new + modified scripts.release-prepare.shsmoke-tested locally:v<cli>.rust_versions, picksv<cli>-1whenv<cli>already exists (queried viagh release list).error: no changes to builds.json — nothing to release.release-body.shrenders a clean markdown body against synthetic per-arch metadata files (full state of every declared pair).verify-image.sh --helpworks; refuses tag-only refs.End-to-end behaviour verifiable by triggering the
releaseworkflow once this PR merges, reviewing the auto-generated PR, merging, and publishing the resulting GitHub Release.