Skip to content

Commit 3a9c3cb

Browse files
cloudwebrtcclaude
andcommitted
ci: only accept next-rc or promote while a package is at an rc
Any other bump moves past the rc's planned stable version, e.g. a patch changeset on 1.4.0.rc1 released 1.4.1 and 1.4.0 never shipped. Reject it in --check and the release run, pointing to next-rc, promote or the Manual Version Bump workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b636a3a commit 3a9c3cb

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎.changeset/README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Mixing stable and rc types for one package, or combining `promote` with
3232
anything else, is rejected. Only rc types are allowed on branches other than
3333
`main`.
3434

35+
While a package is at an rc (e.g. `1.6.0.rc1`), only `next-rc` and `promote`
36+
are accepted for it, so fixes land in the next rc and the planned `1.6.0` still
37+
ships. Any other type would skip it (`patch` would release `1.6.1`). To move
38+
to a different version line, use the Manual Version Bump workflow below.
39+
3540
## How releases happen
3641

3742
1. Every PR is checked by the **Changeset** workflow; invalid changesets fail

‎.github/changesets.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
Supported bump types: patch, minor, major, patch-rc, minor-rc, major-rc,
1313
next-rc, promote. When several changesets touch the same package, the
1414
largest bump wins (an explicit X-rc wins over next-rc). Mixing stable and
15-
rc bumps, or combining promote with anything else, is an error.
15+
rc bumps, or combining promote with anything else, is an error. While a
16+
package is at an rc, only next-rc and promote are accepted for it.
1617
1718
Changesets used by an rc release are kept and recorded in .changeset/pre.json
1819
(package -> file names) instead of being deleted, so later runs skip them. The
@@ -101,6 +102,13 @@ def validate(package: str, kind: str) -> None:
101102
raise click.ClickException(f"{package}: next-rc requires an rc version (got {cur})")
102103
if kind == "promote" and not cur.is_prerelease:
103104
raise click.ClickException(f"{package}: promote requires a pre-release (got {cur})")
105+
# Any other bump would move past the rc's planned stable version, e.g.
106+
# patch on 1.4.0.rc1 releases 1.4.1 and 1.4.0 never ships.
107+
if cur.is_prerelease and kind not in ("next-rc", "promote"):
108+
raise click.ClickException(
109+
f"{package}: {kind} is not allowed while at pre-release {cur}; "
110+
"use next-rc or promote (or the Manual Version Bump workflow)"
111+
)
104112

105113

106114
def apply(package: str, kind: str) -> None:

0 commit comments

Comments
 (0)