Skip to content

feat(release): add scripts/release.sh single-command release flow#100

Merged
George-iam merged 1 commit intomainfrom
feat/release-script-20260410
Apr 11, 2026
Merged

feat(release): add scripts/release.sh single-command release flow#100
George-iam merged 1 commit intomainfrom
feat/release-script-20260410

Conversation

@George-iam
Copy link
Copy Markdown
Contributor

Summary

Single-command release script. Eliminates the manual ritual that caused 5 retries during v0.2.7 release.

Usage

```bash
./scripts/release.sh patch # 0.2.7 → 0.2.8
./scripts/release.sh minor # 0.2.7 → 0.3.0
./scripts/release.sh major # 0.2.7 → 1.0.0
./scripts/release.sh patch --dry-run
```

What it does

  1. Preflight (fail-fast before any work): tools present, clean tree, on main + in sync, npm whoami, gh auth, lint+test+build all pass, CHANGELOG has `[X.Y.Z]` section per D-128
  2. Bump version in 3 files in lockstep: `package.json`, `.claude-plugin/plugin.json`, `templates/plugin-README.md`
  3. Open release PR with body from CHANGELOG, push, wait for user to merge
  4. After merge: pull main, tag, push tag (triggers chained release-binary workflow)
  5. Watch workflow with `gh run watch --exit-status`, fail loudly with run URL if anything broke
  6. Postflight verify: npm version, GitHub release assets, plugin repo plugin.json — print summary

Idempotent: re-running after a partial failure recognizes existing branch/tag and continues.

What this fixes vs v0.2.7 release

v0.2.7 failure How script prevents it
npm publish 401 (not logged in) Preflight runs `npm whoami` first
Forgot to bump badge in plugin-README Lockstep bumps all 3 version files
GitHub Actions anti-recursion broke chain PR #99 already fixed; script just trusts the chained workflow
Wrong clone path (/tmp vs ~/axme-workspace) Script never clones — works in repo root
No verification that all artifacts landed Postflight checks npm + GitHub + plugin repo
CHANGELOG entries skipped (0.2.1-0.2.6 gap) Aborts unless CHANGELOG has `[X.Y.Z]` section (D-128 enforcement)

Smoke test

Locally tested: preflight correctly aborts when working tree is dirty. Full end-to-end will be validated on v0.2.8.

Files

  • `scripts/release.sh` (new, executable)
  • `README.md` — Releasing section pointing to the script

Closes

B-004 (backlog)

🤖 Generated with Claude Code

The v0.2.7 release took ~5 retries due to drift between manual steps:
forgotten badge bumps, npm not logged in, plugin clones in /tmp instead
of workspace, GitHub Actions anti-recursion breaking the workflow chain.
This script eliminates every one of those failure modes.

Usage:
  ./scripts/release.sh patch         # 0.2.7 → 0.2.8
  ./scripts/release.sh minor         # 0.2.7 → 0.3.0
  ./scripts/release.sh major         # 0.2.7 → 1.0.0
  ./scripts/release.sh patch --dry-run

What it does (in order):

1. Preflight checks (fail fast before doing real work):
   - Required tools present (git, gh, npm, node, jq)
   - Clean working tree (untracked .claude/ and CLAUDE.md allowed)
   - On main, in sync with origin
   - npm authenticated (npm whoami) — caught the v0.2.7 401 immediately
   - gh CLI authenticated
   - npm run lint, test, build all pass
   - CHANGELOG.md has the [X.Y.Z] section per D-128 (required decision),
     aborts with instructions if missing

2. Bump version in 3 files in lockstep:
   - package.json (via jq)
   - .claude-plugin/plugin.json (via jq)
   - templates/plugin-README.md (badge URL via sed)
   Verifies no stale references to old version remain.

3. Create release branch (release/vX.Y.Z), commit, push, open PR
   with body extracted from the matching CHANGELOG section.

4. Pause and wait for user to merge the PR.

5. After merge: pull main, verify version is bumped, tag, push tag.
   This triggers the chained release-binary workflow (build matrix →
   release → publish-npm → sync-plugin-repo).

6. Watch the workflow with gh run watch --exit-status, fail loudly with
   the run URL if any job failed.

7. Postflight verify all three artifact landed:
   - npm view @axme/code version
   - gh release view vX.Y.Z (asset count)
   - gh api repos/AxmeAI/axme-code-plugin/contents/.claude-plugin/plugin.json

Idempotent where possible: re-running after a partial failure picks up
where it left off (existing branch, existing tag are recognized and
not re-created).

Smoke tested locally: preflight correctly aborts on dirty tree.
Full end-to-end will be validated on the next release (v0.2.8).

Also documented in README under "Releasing" section.

Closes B-004.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@George-iam George-iam merged commit 3dd3a94 into main Apr 11, 2026
@George-iam George-iam deleted the feat/release-script-20260410 branch April 11, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant