fix(publish): beta tags use PATCH+1 as base, fixing semver precedence

Merged
EO
5mo ago
+74-72

Closes #1997

What changed

Beta tags now use PATCH+1 as their base instead of the current stable.

Before:

v0.7.2 ships → v0.7.2-beta.1, v0.7.2-beta.2, ...

v0.7.2-beta.1 < v0.7.2 by semver — betas are semver-older than stable. ❌

After:

v0.7.2 ships → v0.7.3-beta.1, v0.7.3-beta.2, ...

v0.7.3-beta.1 > v0.7.2 by semver — betas are semver-newer than stable. ✅

Why

Per the semver spec §9, a pre-release version has lower precedence than its associated normal version. Tagging betas against the already-shipped stable base means UpdateChecker (and any semver-aware tool) treats them as older than stable and never offers them as updates.

Gating stable users from receiving betas is handled by the update channel preference in UpdateChecker, not by semver precedence — so there is no regression there.

Notes

  • The rollover logic (PATCH > 9 → bump MINOR) is shared and unchanged.
  • The NEXT_BASE variable is now computed once and reused by both the beta and stable branches, removing duplication.
  • The large suppression comment block in the old code (explaining why the "wrong" base was intentional) has been replaced with a comment explaining why the correct approach is correct.

Summary by cubic

Fixes beta tag precedence by basing betas on PATCH+1 of the latest stable so semver-aware tools (including UpdateChecker) surface them correctly. Updates releasing docs and workflow comments to match the new scheme and examples.

  • Bug Fixes

    • Beta tags now use PATCH+1 of the latest stable as their base (e.g., v0.7.2 → v0.7.3-beta.1).
    • Beta availability stays gated by the update channel in UpdateChecker; only precedence changes.
  • Refactors

    • Compute NEXT_BASE once and reuse for both channels; removed duplicate rollover code.
    • Updated docs/releasing.md and workflow comments to reflect the PATCH+1 beta base, including a note that the HIGHEST_N counter resets when the beta base (NEXT_BASE) changes.

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted beta release versioning so beta tags now branch from the next patch version, with rollover handled consistently.
    • Updated release tagging behavior so release builds continue to use the new patch-based version format.
  • Documentation
    • Updated the releasing guide to reflect the revised beta vs stable tagging rules and corrected examples, including dry-run checks.