fix(release): mark hyphen-suffixed tags as prerelease

Merged
AL
5mo ago
+37-10

Summary

  • Workflow now creates hyphen-suffixed tags (vX.Y.Z-rc<N>, -beta<N>, -alpha<N>) with --prerelease instead of --latest.
  • Bare semver (vX.Y.Z) continues to get --latest.
  • Doc-comment at the top of the file documents the convention.

Why

v0.1.9-rc2 was created by this workflow as a stable --latest release because the only path through the script was gh release create ... --latest with no prerelease branch. bcode.sh/install queries GitHub's /releases/latest, which returns the highest non-prerelease release with latest=true — so an RC became the default install target. A user reported running the one-liner and getting v0.1.9-rc2.

Earlier RCs (rc1, all v0.1.8-rc*) only avoided this because someone manually pre-created the GitHub Release with --prerelease before pushing the tag; the workflow's existing gh release view check then skipped its own create. For rc2 nobody did the manual prep, the workflow created it itself, and it landed as stable.

OpenCode avoids this entirely by publishing betas to a separate repo (anomalyco/opencode-beta). We ship everything to one repo and rely on the prerelease flag, so the flag needs to be right by default.

Fix shape

  • One if [[ "$TAG" == *-* ]] branch in the Ensure GitHub Release exists step.
  • Existing-release flags are not touched on re-run; fix manually via gh release edit if needed.
  • Doc-comment updated to spell out the convention.

Out of scope

  • OPENCODE_CHANNEL is still latest for both stable and prerelease — not relevant to install resolution.
  • Retroactive flip of v0.1.9-rc2 already done out-of-band (gh release edit v0.1.9-rc2 --prerelease --latest=false), so /releases/latest returns v0.1.8 again.

Summary by cubic

Mark hyphen-suffixed tags (like vX.Y.Z-rcN, -betaN, -alphaN) as GitHub prereleases and keep bare semver tags (vX.Y.Z) as latest. This prevents RC/beta releases from being returned by /releases/latest and installed by default.

  • Bug Fixes
    • In “Ensure GitHub Release exists”, create with --prerelease if $TAG contains a hyphen; otherwise use --latest.
    • Skip changing flags if a release already exists; fix manually with gh release edit if needed.
    • Added a doc comment outlining tag conventions and how flags are set.