Repository navigation
ci: cut releases from a workflow that runs release.sh - #167
Conversation
| concurrency: | ||
| group: cut-release | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
nit: Move concurrency from the workflow level to the publish and prepare jobs (not blocking).
The workflow-level group applies to every closed PR on main, including runs where both jobs skip. GitHub keeps one running and one pending run per group. A newer pending run cancels the older pending run, even with cancel-in-progress: false. A release-PR merge run can wait behind another close event. A third close event then cancels the release run, and no tag is pushed. Job-level concurrency only applies to jobs that pass their if, so unrelated PR closes never enter the group.
| env: | ||
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| run: ./scripts/release.sh prepare "${{ inputs.bump }}" |
There was a problem hiding this comment.
nit: Pass inputs.bump through env instead of ${{ }} in the script (not blocking).
The runner expands ${{ inputs.bump }} into the shell source before release.sh validates the value. A value with " or $(...) runs as shell code with the App token in the environment. GitHub's script-injection hardening guide recommends an intermediate environment variable.
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: ./scripts/release.sh prepare "${{ inputs.bump }}" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| BUMP: ${{ inputs.bump }} | |
| run: ./scripts/release.sh prepare "$BUMP" |
Why
Releases still needed a laptop: run
release.sh prepare, wait for the PR, then runrelease.sh publishfrom a cleanmaincheckout. The Python SDK already cuts releases from CI; this brings the Rust crate to the same flow.What
.github/workflows/cut-release.yml(mirrors sdk-python's workflow):workflow_dispatchwith abumpinput runs the existing./scripts/release.sh prepare, which bumpsCargo.toml, rolls[Unreleased]into a versioned changelog section, pushesrelease/vX.Y.Z, opens the PR, and then enables squash auto-merge on it.release/v*PR merges, theTag releasejob runs the existing./scripts/release.sh publish, which tagsmain. The tag push triggerspublish.yml(crates.io) andrelease.yml(GitHub Release) exactly as before.GITHUB_TOKENevents trigger nothing). All actions are SHA-pinned to the versions already used in this repo;cargo-editis installed with a pinnedtaiki-e/install-action.scripts/release.sh: only the usage text, PR body, and final echo now describe the CI path. No logic changes.RELEASING.md: release steps now point at the workflow; adds a "Recover a missing tag" section; keeps the GitHub Release recovery section.Releasing afterwards
gh workflow run cut-release.yml -f bump=minor # or patch | major | X.Y.Z