Executes a full release cycle for the riddl project. Follow each step in order. STOP immediately if any assertion fails and report the problem.
The user should provide a version number (e.g., 1.10.1). If
not provided, analyze changes since the last tag and recommend
a version bump per semver (MAJOR/MINOR/PATCH), then wait for
the user to confirm.
-
Assert current branch is
main:git branch --show-currentIf not on
main, ask the user before switching. Never publish fromdevelopmentor feature branches. -
Assert working tree is clean:
git status --porcelainIf dirty, list the uncommitted files and ask the user how to proceed.
-
Unset GITHUB_TOKEN to avoid auth conflicts:
unset GITHUB_TOKEN -
Verify the version tag does not already exist:
git tag -l <VERSION>
-
Run the full test suite and confirm all tests pass:
sbt clean test -
Create an annotated git tag:
git tag -a <VERSION> -m "Release <VERSION>" -
Push the tag to origin:
git push origin <VERSION> -
Publish all modules to GitHub Packages:
sbt clean test publishVerify the published version matches
<VERSION>in the sbt output (sbt-dynver derives version from the tag). -
Create a GitHub release:
gh release create <VERSION> --title "Release <VERSION>" \ --generate-notesThis triggers the Release Artifacts workflow (native builds, Homebrew formula update) and the npm-publish workflow automatically.
-
Run
git statusto confirm the working tree is still clean. -
Confirm the release exists:
gh release view <VERSION> -
Switch back to
developmentand merge the tag forward:git checkout development git merge main git push -
Report a summary: tag, commit SHA, release URL, and any CI workflows triggered.
- If tests fail in step 5: fix and re-run. Do NOT proceed.
- If tag push fails in step 7: check if the tag exists remotely.
- If publish fails in step 8: check credentials and retry.
- If
gh release createfails in step 9: the tag is already pushed, so the release can be created manually or retried. - Never force-push tags without explicit user approval.