Repository navigation
feat(version): support prerelease channels for calver targets - #347
Merged
Merged
Conversation
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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #335 (commits 1 and 5). I removed commit 4, because
semver.Comparealready 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:
Why
Some calver projects ship betas, for example
2026.11.1-beta.1, then2026.11.1-beta.2, then2026.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
-<channel>.<N>to that version.Ngoes up while that version stays the same.Nstarts again at 1 when that version changes.Stable runs still ignore prerelease tags.
Examples
Format
YYYY.0M.MICRO,betachannel, release in November 2026:2026.11.1-beta.1v2026.11.1-beta.12026.11.1-beta.2v2026.11.12026.11.2-beta.1v2026.11.2-beta.12026.11.2-beta.2v2026.11.1(withv2026.11.2-beta.*on the beta branch)2026.11.2v2026.10.4-beta.22026.11.1-beta.1Format with an optional micro segment (7e7bb77),
YYYY.M.D[.MICRO], release on 2026-09-11:2026.9.11-beta.1v2026.9.11-beta.12026.9.11-beta.2v2026.9.112026.9.11.1-beta.1v2026.9.11-beta.22026.9.11Impact
Tests
internal/version/calver_test.gocovers the examples above, including the optional micro format.tests/release_calver_prerelease_test.gocovers a full channel run.