Skip to content

feat(version): support prerelease channels for calver targets - #347

Merged
ValentinLutz merged 2 commits into
monkescience:mainfrom
nateships:feat/calver-prerelease
Nov 2, 2026
Merged

ValentinLutz merged 2 commits into
monkescience:mainfrom
nateships:feat/calver-prerelease

Conversation

@nateships

Copy link
Copy Markdown
Contributor

Split from #335 (commits 1 and 5). I removed commit 4, because semver.Compare already returns 0 for equal suffixes.

What

Calver targets can now release on a prerelease channel.

Before this change, a channel run with a calver target failed with this error:

prerelease channel "beta" supports semver targets only

Why

Some calver projects ship betas, for example 2026.11.1-beta.1, then 2026.11.1-beta.2, then 2026.11.1.

Channels already work the same for all version schemes. This includes branches, channel changelogs, and prerelease releases on the provider. Only the calver strategy refused prereleases.

How it works

  1. yeet finds the version that the next stable release gets now.
  2. yeet adds -<channel>.<N> to that version.
  3. N goes up while that version stays the same.
  4. N starts again at 1 when that version changes.

Stable runs still ignore prerelease tags.

Examples

Format YYYY.0M.MICRO, beta channel, release in November 2026:

Latest tag on the branch Run Next version
none beta 2026.11.1-beta.1
v2026.11.1-beta.1 beta 2026.11.1-beta.2
v2026.11.1 beta 2026.11.2-beta.1
v2026.11.2-beta.1 beta 2026.11.2-beta.2
v2026.11.1 (with v2026.11.2-beta.* on the beta branch) stable 2026.11.2
v2026.10.4-beta.2 beta 2026.11.1-beta.1

Format with an optional micro segment (7e7bb77), YYYY.M.D[.MICRO], release on 2026-09-11:

Latest tag on the branch Run Next version
none beta 2026.9.11-beta.1
v2026.9.11-beta.1 beta 2026.9.11-beta.2
v2026.9.11 beta 2026.9.11.1-beta.1
v2026.9.11-beta.2 stable 2026.9.11

Impact

  • User-visible: calver targets work on prerelease channels. Stable calver runs do not change.
  • The error for an unsupported target has new text.
  • The schema no longer says that channels are for semver only.
  • Security: none.

Tests

  • internal/version/calver_test.go covers the examples above, including the optional micro format.
  • tests/release_calver_prerelease_test.go covers a full channel run.

A calver prerelease adds the channel suffix to the version that the next
stable release would get, such as 2026.11.2-beta.1. The counter continues
while that version stays the same and restarts at 1 in a new period. A
stable release in the same period then takes that version.

Calver tags with a semver prerelease suffix now parse, sort below their
stable release, and update version file markers.
The counter restarts when the version the next stable release would get
changes, such as after a stable release or in a new period, not only in
a new period.
@ValentinLutz
ValentinLutz merged commit fc8a99c into monkescience:main Nov 2, 2026
13 checks passed
@monkescience-yeet monkescience-yeet Bot mentioned this pull request Nov 2, 2026
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.

2 participants