Skip to content

Commit b95697a

Browse files
authored
ci: rewrite release workflow to be fully GitHub Actions-driven (#25162)
Replace the local interactive release CLI and legacy shell scripts with a non-interactive Go tool (`scripts/release-action/`) and a rewritten `release.yaml` workflow. Release managers trigger releases from the GitHub Actions UI by selecting a branch, picking a release type (`rc`, `release`, or `create-release-branch`), and optionally providing a commit SHA. The Go tool has four subcommands: `calculate-version` (computes next version from git state), `generate-notes` (release notes from commit log and PR metadata), `publish` (creates GitHub release with checksums), and the workflow handles tag creation, branch creation, building, and downstream publishing. `scripts/version.sh` fallback now uses `git describe` (nearest ancestor tag) instead of global latest so dev builds on release branches show the correct version series.
1 parent d5b0e93 commit b95697a

14 files changed

Lines changed: 2482 additions & 175 deletions

File tree

.github/workflows/release.yaml

Lines changed: 228 additions & 142 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,4 @@ license.txt
115115

116116
# Agent planning documents (local working files).
117117
docs/plans/
118+
/release-action

docs/about/contributing/CONTRIBUTING.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -211,55 +211,60 @@ be applied selectively or to discourage anyone from contributing.
211211

212212
## Releases
213213

214-
Coder releases are initiated via
215-
[`./scripts/release.sh`](https://github.com/coder/coder/blob/main/scripts/release.sh)
216-
and automated via GitHub Actions. Specifically, the
214+
Coder releases are managed entirely through the
217215
[`release.yaml`](https://github.com/coder/coder/blob/main/.github/workflows/release.yaml)
218-
workflow.
219-
220-
Release notes are automatically generated from commit titles and PR metadata.
216+
GitHub Actions workflow, triggered manually via "Run workflow" in the Actions
217+
tab. Release notes are automatically generated from commit titles and PR
218+
metadata.
221219

222220
### Release types
223221

224-
| Type | Tag | Branch | Purpose |
225-
|------------------------|---------------|---------------|-----------------------------------------|
226-
| RC (release candidate) | `vX.Y.0-rc.W` | `main` | Ad-hoc pre-release for customer testing |
227-
| Release | `vX.Y.0` | `release/X.Y` | First release of a minor version |
228-
| Patch | `vX.Y.Z` | `release/X.Y` | Bug fixes and security patches |
222+
| Type | Tag | Source | Purpose |
223+
|------------------------|---------------|------------------|---------------------------------------|
224+
| RC (release candidate) | `vX.Y.0-rc.W` | `main` or branch | Pre-release for testing |
225+
| Create release branch | `vX.Y.0-rc.W` | `main` | Cut `release/X.Y` + tag RC atomically |
226+
| Release | `vX.Y.0` | `release/X.Y` | First release of a minor version |
227+
| Patch | `vX.Y.Z` | `release/X.Y` | Bug fixes and security patches |
229228

230229
### Workflow
231230

232-
RC tags are created directly on `main`. The `release/X.Y` branch is only cut
233-
when the release is ready. This avoids cherry-picking main's progress onto
234-
a release branch between the first RC and the release.
231+
RC tags can be created from `main` or from a release branch. The
232+
`create-release-branch` type creates `release/X.Y` and tags the next RC in one
233+
step, continuing the RC numbering sequence.
235234

236235
```text
237-
main: ──●──●──●──●──●──●──●──●──●──
238-
↑ ↑ ↑
239-
rc.0 rc.1 cut release/2.34, tag v2.34.0
240-
\
241-
release/2.34: ──●── v2.34.1 (patch)
236+
main: --*--*--*--*--*--*--*--*--*--
237+
| rc.0 rc.1 |
238+
| +--- create-release-branch ---+
239+
| |
240+
| release/2.34: --*-- rc.2 -- rc.3 -- v2.34.0
241+
|
242+
+-- (more RCs on main for next cycle)
242243
```
243244

244-
1. **RC:** On `main`, run `./scripts/release.sh`. The tool suggests the next
245-
RC version and tags it on `main`.
246-
2. **Release:** When the RC is blessed, create `release/X.Y` from `main` (or
247-
the specific RC commit). Switch to that branch and run
248-
`./scripts/release.sh`, which suggests `vX.Y.0`.
249-
3. **Patch:** Cherry-pick fixes onto `release/X.Y` and run
250-
`./scripts/release.sh` from that branch.
245+
1. **RC:** Go to [Actions > Release](https://github.com/coder/coder/actions/workflows/release.yaml),
246+
click "Run workflow", select `main` (or a release branch) from the "Use
247+
workflow from" dropdown, choose `rc`, and optionally provide a commit SHA
248+
(defaults to HEAD). The workflow calculates the next RC version
249+
automatically.
250+
2. **Create release branch:** Select `main` in the dropdown, choose
251+
`create-release-branch`, and optionally provide a commit SHA. This creates
252+
`release/X.Y` and tags the next RC atomically.
253+
3. **Release:** Select the release branch (e.g. `release/2.34`) from the
254+
dropdown and choose `release`. No other inputs needed.
255+
4. **Patch:** Cherry-pick fixes onto `release/X.Y`, select that branch from
256+
the dropdown, and choose `release`.
251257

252-
The release tool warns if you try to tag a non-RC on `main` or an RC on a
253-
release branch.
258+
The workflow validates that commits are on the expected branch for each release
259+
type.
254260

255-
### Creating a release (via workflow dispatch)
261+
### Retrying a failed release
256262

257263
If the
258264
[`release.yaml`](https://github.com/coder/coder/actions/workflows/release.yaml)
259-
workflow fails after the tag has been pushed, retry it from the GitHub Actions
260-
UI: press "Run workflow", set "Use workflow from" to the tag (e.g.
261-
`Tag: v2.34.0`), select the correct release channel, and do **not** select
262-
dry-run.
265+
workflow fails after the tag has been pushed, re-run the failed jobs from the
266+
GitHub Actions UI. The `prepare-release` job is idempotent and will detect
267+
the existing tag.
263268

264269
To test the workflow without publishing, select dry-run.
265270

0 commit comments

Comments
 (0)