|
| 1 | +# Releasing mmx-cli |
| 2 | + |
| 3 | +Releases are tag-driven. The repository's `package.json` always uses the |
| 4 | +development placeholder version `0.0.0-dev`; do not change it for a release. |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | + |
| 8 | +- The commit to release is on `main`. |
| 9 | +- CI has passed for that commit. |
| 10 | +- The release version is a new SemVer version, for example `1.0.23`. |
| 11 | +- The `NPM_TOKEN` repository secret remains configured for npm publishing. |
| 12 | + |
| 13 | +## Publish a release |
| 14 | + |
| 15 | +Create an annotated `v`-prefixed tag on the commit to release and push it: |
| 16 | + |
| 17 | +```bash |
| 18 | +git switch main |
| 19 | +git pull --ff-only |
| 20 | +git tag -a v1.0.23 -m "Release 1.0.23" |
| 21 | +git push origin v1.0.23 |
| 22 | +``` |
| 23 | + |
| 24 | +The `Release` GitHub Actions workflow validates the tag, derives `1.0.23` as |
| 25 | +the release version, builds the CLI with that version, and creates a temporary |
| 26 | +npm tarball whose `package.json` has the matching version. It then creates a |
| 27 | +GitHub Release and publishes that tarball to npm. |
| 28 | + |
| 29 | +## Verify |
| 30 | + |
| 31 | +```bash |
| 32 | +gh run list --workflow release.yml --branch v1.0.23 --limit 1 |
| 33 | +npm view mmx-cli@1.0.23 version |
| 34 | +``` |
| 35 | + |
| 36 | +The npm version and `mmx --version` from the published package should both |
| 37 | +match the tag without its `v` prefix. |
| 38 | + |
| 39 | +## Failed releases |
| 40 | + |
| 41 | +Do not move or reuse an existing tag. npm versions are immutable. |
| 42 | + |
| 43 | +After fixing the issue, publish a new patch version with a new tag. If the |
| 44 | +failure occurred after the GitHub Release was created but before npm publish, |
| 45 | +use a new version as well; the original release can be marked as a prerelease |
| 46 | +or deleted according to the repository's release policy. |
0 commit comments