Skip to content

Commit 6998d22

Browse files
committed
docs: document tag-driven releases
1 parent a3beefa commit 6998d22

3 files changed

Lines changed: 53 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ bun test --grep "auth login"
4444

4545
### Publishing
4646

47-
```bash
48-
npm publish
49-
```
47+
- Releases are tag-driven; see `docs/releasing.md`.
48+
- Do not change `package.json` from its `0.0.0-dev` development version for a release.
5049

5150
## Code Style
5251

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ mmx vision photo.jpg
6060
mmx quota
6161
```
6262

63+
## Releasing
64+
65+
Maintainers publish releases by pushing a SemVer Git tag; the release workflow
66+
derives the npm package version from that tag. See [the release guide](docs/releasing.md).
67+
6368
## Commands
6469

6570
### `mmx text`

docs/releasing.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

Comments
 (0)