Skip to content

Automate versioned releases behind a green-Self-test gate - #3

Merged
sks merged 1 commit into
mainfrom
release-automation
Nov 11, 2026
Merged

sks merged 1 commit into
mainfrom
release-automation

Conversation

@sks

@sks sks commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

What

Automates cutting versioned releases of cce-action, so "tags are published after self-test CI is green" (README) becomes one click instead of a manual tag/release dance.

New Release workflow (workflow_dispatch on main)

  • Gate: refuses to release unless a Self-test run is green for the exact commit being released — a red main can never ship a tag.
  • Version: the input can pin it explicitly (v0.2.0), or be left empty to derive the next version from commit subjects since the last tag (feat/feat! → minor bump, fix → patch bump; on the 0.x line a breaking change bumps minor, not major, matching this repo's v0.x releases under the v1 moving tag).
  • Moving tag: re-points v1 at the release (best-effort with a ::warning:: if a tag-protection rule blocks the force push — the release itself is still published).
  • Notes: generated with the classified commits grouped into Features / Fixes / Other plus an optional one-line summary input.

Scripts

  • .github/scripts/cut-release.sh — the whole flow, with a --dry-run mode for local preview: prints the target, derived version, range, and rendered notes without tagging anything. Rejects an already-existing tag.
  • .github/scripts/classify-commits.py — subject classification + version bump + notes rendering; classification reason printed to stderr.

README

Versioning section now documents the Release workflow, the bump policy, and the local dry-run command.

Verification (local, against real repo state)

  • bash -n / py_compile / YAML parse all clean.
  • Dry run on current main (3ffab6e, since v0.1.1): derives v0.2.0 (PR Add scan-timeout guard, debug log-flood warning, and JS self-test #2's "Add scan-timeout guard..." → minor), notes grouped Features/Fixes correctly.
  • Heuristics: feat: → v0.3.0, fix(mapper): → v0.2.1, feat!: → v0.3.0 (0.x breaking policy), chore:/docs: → v0.2.1; same logic on a v1.2.3 base → 1.3.0 / 1.2.4 / 1.3.0.
  • Edge cases: explicit RELEASE_VERSION override honored, existing tag rejected with an actionable error, NOTES_LINE appears at the top of the notes.
  • The dry run also caught (and the PR fixes) a shell-precedence bug where git log ... || true | python3 skipped the classifier entirely.

First use

After this merges and Self-test is green, run the Release workflow on main with an empty version — it derives v0.2.0 and moves v1, publishing the scan-timeout input, the debug log warning, and the JAVASCRIPT self-test from #2.

Follow-ups (not in this PR)

  • Zero-click variant: trigger the same job via workflow_run on Self-test success instead of a manual dispatch, if you want a release on every green merge.
  • actions/checkout@v4 / actions/upload-artifact@v4 target Node 20 (deprecation warning in current runs); a bump to v5 clears the annotation.

Releases were cut by hand (tag, release notes, moving v1 tag). The new
Release workflow (workflow_dispatch on main) refuses to release unless
Self-test is green for the exact commit, derives the next version from
conventional-commit subjects since the last tag when no explicit version
is given (feat or breaking -> minor, fix -> patch; breaking bumps minor
on the 0.x line), re-points the v1 moving tag, and publishes grouped
notes.

cut-release.sh has a --dry-run mode for local preview; the dry run
against current main derives v0.2.0 (first use: publish PR #2).
@sks
sks merged commit a0cbdcc into main Nov 11, 2026
3 checks passed
@sks
sks deleted the release-automation branch November 13, 2026 22:01
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.

1 participant