Skip to content

Commit 1fb56a5

Browse files
committed
docs: document release procedure in AGENTS.md
1 parent f3c9ec0 commit 1fb56a5

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@ The project uses pnpm workspaces. Key commands:
4141
- When creating a PR, do not include a separate test plan section in the body. Link to any relevant issues under discussion, and use the same copywriting guidelines from "Commenting on issues and PRs": concise maintainer voice, prose over templates, and validation details only when they are material to the reader.
4242
- NEVER bump the version in `packages/zod/package.json` (or any package's `package.json`). A version bump is the only thing that triggers a release; everything else (including direct pushes to `main`) is recoverable until that happens. If a version bump is genuinely needed, ask first.
4343

44+
## Cutting a release
45+
46+
Only do this when the user explicitly asks. Pushing a version bump to `main` triggers `.github/workflows/release.yml`, which publishes to npm + JSR and creates a `v<version>` GitHub release. There is no undo.
47+
48+
Three files must be bumped together — `pnpm check:semver` runs in pre-commit and `prepublishOnly`, and will fail the commit if they disagree:
49+
50+
- `packages/zod/package.json``version`
51+
- `packages/zod/jsr.json``version`
52+
- `packages/zod/src/v4/core/versions.ts``major` / `minor` / `patch`
53+
54+
Procedure:
55+
56+
```bash
57+
# Make sure main is clean and up to date first.
58+
git checkout main && git pull
59+
60+
# Bump all three files to the new x.y.z, then:
61+
git add packages/zod/package.json packages/zod/jsr.json packages/zod/src/v4/core/versions.ts
62+
git commit -m "<x.y.z>" # commit message is just the version, e.g. "4.4.3"
63+
git push origin main
64+
```
65+
66+
The release workflow only fires on changes under `packages/zod/package.json`, `packages/zod/src/**`, or the workflow file itself, so the bump must include `package.json`. Watch the Actions tab to confirm `build_and_publish` succeeds.
67+
4468
## Iterating on a contributor PR in a worktree
4569

4670
When asked to make changes on top of an open PR (e.g. as a maintainer review suggestion), use a worktree so `main` stays clean:

0 commit comments

Comments
 (0)