|
| 1 | +--- |
| 2 | +name: release-clawpatch |
| 3 | +description: "clawpatch release: version/changelog, CI, npm publish, GitHub release, verify." |
| 4 | +--- |
| 5 | + |
| 6 | +# Clawpatch Release |
| 7 | + |
| 8 | +## Scope |
| 9 | + |
| 10 | +Release `~/Projects/clawpatch` as the public npm package `clawpatch`. |
| 11 | + |
| 12 | +Use `$npm` and `$one-password` rules for registry auth. Keep all `op` and npm secret work inside one persistent tmux session and temp npmrc. Never print tokens, passwords, or OTPs. |
| 13 | + |
| 14 | +## Workflow |
| 15 | + |
| 16 | +1. Start clean on `main`. |
| 17 | + - `cd ~/Projects/clawpatch` |
| 18 | + - `git status --short --branch` |
| 19 | + - `git pull --ff-only` |
| 20 | + - Confirm target version is not already tagged or released: `git tag --list "vX.Y.Z"` and `gh release view vX.Y.Z --repo openclaw/clawpatch`. |
| 21 | + - Confirm npm state: `npm view clawpatch version dist-tags time --json`. |
| 22 | + |
| 23 | +2. Prep release files. |
| 24 | + - Set `package.json` version to target. |
| 25 | + - Change top changelog section from `Unreleased` to `X.Y.Z - YYYY-MM-DD`. |
| 26 | + - Ensure release notes are the changelog body for that version and include all user-facing changes. |
| 27 | + - Run `pnpm install --lockfile-only`; commit lockfile only if it actually changes. |
| 28 | + |
| 29 | +3. Prove locally before publishing. |
| 30 | + - Run `pnpm typecheck && pnpm lint && pnpm format:check && pnpm test && pnpm build && pnpm pack:smoke`. |
| 31 | + - Fix failures before continuing. |
| 32 | + |
| 33 | +4. Commit and push release prep. |
| 34 | + - Commit with `committer "chore(release): X.Y.Z" CHANGELOG.md package.json [pnpm-lock.yaml]`. |
| 35 | + - `git push origin main`. |
| 36 | + - Watch CI/CodeQL for the release commit: |
| 37 | + - `gh run list --repo openclaw/clawpatch --branch main --commit <sha> --json databaseId,workflowName,status,conclusion,url,headSha` |
| 38 | + - `gh run view <run_id> --repo openclaw/clawpatch --json status,conclusion,url,jobs` |
| 39 | + - Do not publish until release-commit CI and CodeQL are green. |
| 40 | + |
| 41 | +5. Publish npm. |
| 42 | + - Use a temp npmrc, never the default user npmrc. |
| 43 | + - First try `npm whoami`; if unauthenticated, use npm web login in the tmux session: |
| 44 | + - `NPM_CONFIG_USERCONFIG="$tmp_npmrc" npm login --auth-type=web --registry=https://registry.npmjs.org/` |
| 45 | + - Open/approve browser login if prompted. |
| 46 | + - For publish, fetch a fresh OTP from the `npmjs` 1Password item inside the same tmux session. |
| 47 | + - Publish with `NPM_CONFIG_USERCONFIG="$tmp_npmrc" npm publish --access public --otp "$NPM_OTP"`. |
| 48 | + - Clean temp npmrc/work dirs after publish. |
| 49 | + - If publish says the version already exists, verify npm metadata and continue only if it matches the release commit/package contents. |
| 50 | + |
| 51 | +6. Verify npm before GitHub release. |
| 52 | + - `npm view clawpatch@X.Y.Z version dist-tags dist.tarball dist.integrity time --json` |
| 53 | + - Required: version is `X.Y.Z`, `latest` points to `X.Y.Z`, tarball URL exists, integrity exists, publish time exists. |
| 54 | + |
| 55 | +7. Tag and create GitHub release. |
| 56 | + - Build release notes from changelog plus npm/proof: |
| 57 | + - npm version page |
| 58 | + - registry tarball |
| 59 | + - integrity string |
| 60 | + - CI and CodeQL run URLs |
| 61 | + - local proof command |
| 62 | + - Use temp files for public GitHub bodies. |
| 63 | + - `git tag -a vX.Y.Z <release_sha> -m "vX.Y.Z"` |
| 64 | + - `git push origin vX.Y.Z` |
| 65 | + - `gh release create vX.Y.Z --repo openclaw/clawpatch --title "vX.Y.Z" --notes-file "$notes"` |
| 66 | + |
| 67 | +8. Release verify. |
| 68 | + - `npm view clawpatch@X.Y.Z version dist-tags.latest dist.tarball dist.integrity time.X.Y.Z --json` |
| 69 | + - `gh release view vX.Y.Z --repo openclaw/clawpatch --json tagName,url,body,isDraft,isPrerelease` |
| 70 | + - Confirm release body contains changelog notes, npm version link, tarball, integrity, and CI/proof. |
| 71 | + - Confirm tag points at the release commit: `git rev-list -n1 vX.Y.Z`. |
| 72 | + |
| 73 | +9. Post-release closeout. |
| 74 | + - Add next patch section at top of `CHANGELOG.md`: `## X.Y.(Z+1) - Unreleased`. |
| 75 | + - Commit with `committer "docs(changelog): open X.Y.(Z+1)" CHANGELOG.md`. |
| 76 | + - Push `main`. |
| 77 | + - Watch closeout CI until green. |
| 78 | + - Final: `git checkout main && git pull --ff-only && git status --short --branch`. |
| 79 | + |
| 80 | +## Notes |
| 81 | + |
| 82 | +- Do not create the GitHub release before npm publish is verified; the release body must include npm proof. |
| 83 | +- If npm auth scripts fail, keep the same tmux session. Do not start a second secret session unless the first is unusable. |
| 84 | +- Avoid broad secret inspection. Query exact `npmjs` fields only. |
| 85 | +- Public `gh` comments/releases should use temp `--body-file` / `--notes-file`, not inline quoted bodies. |
0 commit comments