paperclip/doc/RELEASING.md

227 lines
5.9 KiB
Markdown
Raw Normal View History

2026-03-09 08:49:42 -05:00
# Releasing Paperclip
Maintainer runbook for shipping Paperclip across npm, GitHub, and the website-facing changelog surface.
2026-03-09 08:49:42 -05:00
The release model is now commit-driven:
2026-03-09 08:49:42 -05:00
1. Every push to `master` publishes a canary automatically.
2. Stable releases are manually promoted from a chosen tested commit or canary tag.
3. Stable release notes live in `releases/vYYYY.M.D.md`.
4. Only stable releases get GitHub Releases.
2026-03-09 08:49:42 -05:00
## Versioning Model
2026-03-09 08:49:42 -05:00
Paperclip uses calendar versions that still fit semver syntax:
2026-03-09 08:49:42 -05:00
- stable: `YYYY.M.D`
- canary: `YYYY.M.D-canary.N`
2026-03-09 08:49:42 -05:00
Examples:
2026-03-09 08:49:42 -05:00
- stable on March 17, 2026: `2026.3.17`
- fourth canary on March 17, 2026: `2026.3.17-canary.3`
2026-03-09 08:49:42 -05:00
Important constraints:
2026-03-09 08:49:42 -05:00
- do not use leading zeroes such as `2026.03.17`
- do not use four numeric segments such as `2026.03.17.1`
- the semver-safe canary form is `2026.3.17-canary.1`
2026-03-09 08:49:42 -05:00
## Release Surfaces
2026-03-09 08:49:42 -05:00
Every stable release has four separate surfaces:
2026-03-09 08:49:42 -05:00
1. **Verification** — the exact git SHA passes typecheck, tests, and build
2. **npm**`paperclipai` and public workspace packages are published
3. **GitHub** — the stable release gets a git tag and GitHub Release
4. **Website / announcements** — the stable changelog is published externally and announced
2026-03-09 08:49:42 -05:00
A stable release is done only when all four surfaces are handled.
2026-03-09 08:49:42 -05:00
Canaries only cover the first two surfaces plus an internal traceability tag.
2026-03-09 08:49:42 -05:00
## Core Invariants
2026-03-09 08:49:42 -05:00
- canaries publish from `master`
- stables publish from an explicitly chosen source ref
- tags point at the original source commit, not a generated release commit
- stable notes are always `releases/vYYYY.M.D.md`
- canaries never create GitHub Releases
- canaries never require changelog generation
2026-03-09 08:49:42 -05:00
## TL;DR
2026-03-09 08:49:42 -05:00
### Canary
2026-03-09 08:49:42 -05:00
Every push to `master` runs [`.github/workflows/release-canary.yml`](../.github/workflows/release-canary.yml).
It:
- verifies the pushed commit
- computes the canary version for the current UTC date
- publishes under npm dist-tag `canary`
- creates a git tag `canary/vYYYY.M.D-canary.N`
2026-03-09 13:55:30 -05:00
Users install canaries with:
```bash
2026-03-09 13:55:30 -05:00
npx paperclipai@canary onboard
```
### Stable
2026-03-09 08:49:42 -05:00
Use [`.github/workflows/release-stable.yml`](../.github/workflows/release-stable.yml) from the Actions tab.
2026-03-09 08:49:42 -05:00
Inputs:
2026-03-09 08:49:42 -05:00
- `source_ref`
- commit SHA, branch, or tag
- `stable_date`
- optional UTC date override in `YYYY-MM-DD`
- `dry_run`
- preview only when true
2026-03-09 08:49:42 -05:00
Before running stable:
2026-03-09 08:49:42 -05:00
1. pick the canary commit or tag you trust
2. create or update `releases/vYYYY.M.D.md` on that source ref
3. run the stable workflow from that source ref
2026-03-09 08:49:42 -05:00
The workflow:
2026-03-09 08:49:42 -05:00
- re-verifies the exact source ref
- publishes `YYYY.M.D` under npm dist-tag `latest`
- creates git tag `vYYYY.M.D`
- creates or updates the GitHub Release from `releases/vYYYY.M.D.md`
2026-03-09 08:49:42 -05:00
## Local Commands
2026-03-09 08:49:42 -05:00
### Preview a canary locally
2026-03-09 08:49:42 -05:00
```bash
./scripts/release.sh canary --dry-run
2026-03-09 08:49:42 -05:00
```
### Preview a stable locally
2026-03-09 09:06:45 -05:00
```bash
./scripts/release.sh stable --dry-run
2026-03-09 09:06:45 -05:00
```
### Publish a stable locally
2026-03-09 08:49:42 -05:00
This is mainly for emergency/manual use. The normal path is the GitHub workflow.
2026-03-09 09:06:45 -05:00
```bash
./scripts/release.sh stable
git push public-gh refs/tags/vYYYY.M.D
./scripts/create-github-release.sh YYYY.M.D
2026-03-09 09:06:45 -05:00
```
## Stable Changelog Workflow
2026-03-09 08:49:42 -05:00
Stable changelog files live at:
2026-03-09 08:49:42 -05:00
- `releases/vYYYY.M.D.md`
2026-03-09 08:49:42 -05:00
Canaries do not get changelog files.
2026-03-09 08:49:42 -05:00
Recommended local generation flow:
2026-03-09 08:49:42 -05:00
```bash
VERSION=2026.3.17
claude --print --output-format stream-json --verbose --dangerously-skip-permissions --model claude-opus-4-6 "Use the release-changelog skill to draft or update releases/v${VERSION}.md for Paperclip. Read doc/RELEASING.md and .agents/skills/release-changelog/SKILL.md, then generate the stable changelog for v${VERSION} from commits since the last stable tag. Do not create a canary changelog."
2026-03-09 08:49:42 -05:00
```
The repo intentionally does not run this through GitHub Actions because:
2026-03-09 08:49:42 -05:00
- canaries are too frequent
- stable notes are the only public narrative surface that needs LLM help
- maintainer LLM tokens should not live in Actions
2026-03-09 08:49:42 -05:00
## Smoke Testing
2026-03-09 09:06:45 -05:00
For a canary:
2026-03-09 08:49:42 -05:00
```bash
PAPERCLIPAI_VERSION=canary ./scripts/docker-onboard-smoke.sh
```
For the current stable:
```bash
PAPERCLIPAI_VERSION=latest ./scripts/docker-onboard-smoke.sh
```
Useful isolated variants:
```bash
HOST_PORT=3232 DATA_DIR=./data/release-smoke-canary PAPERCLIPAI_VERSION=canary ./scripts/docker-onboard-smoke.sh
HOST_PORT=3233 DATA_DIR=./data/release-smoke-stable PAPERCLIPAI_VERSION=latest ./scripts/docker-onboard-smoke.sh
```
2026-03-09 08:49:42 -05:00
Minimum checks:
2026-03-09 13:55:30 -05:00
- `npx paperclipai@canary onboard` installs
- onboarding completes without crashes
- the server boots
- the UI loads
- basic company creation and dashboard load work
## Rollback
2026-03-09 08:49:42 -05:00
Rollback does not unpublish versions.
2026-03-09 13:55:30 -05:00
It only moves the `latest` dist-tag back to a previous stable:
2026-03-09 13:55:30 -05:00
```bash
./scripts/rollback-latest.sh 2026.3.16 --dry-run
./scripts/rollback-latest.sh 2026.3.16
2026-03-09 13:55:30 -05:00
```
Then fix forward with a new stable release date.
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
## Failure Playbooks
2026-03-09 08:49:42 -05:00
### If the canary publishes but smoke testing fails
2026-03-09 08:49:42 -05:00
Do not run stable.
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
Instead:
2026-03-09 08:49:42 -05:00
1. fix the issue on `master`
2. merge the fix
3. wait for the next automatic canary
4. rerun smoke testing
2026-03-09 08:49:42 -05:00
### If stable npm publish succeeds but tag push or GitHub release creation fails
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
This is a partial release. npm is already live.
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
Do this immediately:
2026-03-09 08:49:42 -05:00
1. push the missing tag
2. rerun `./scripts/create-github-release.sh YYYY.M.D`
3. verify the GitHub Release notes point at `releases/vYYYY.M.D.md`
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
Do not republish the same version.
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
### If `latest` is broken after stable publish
2026-03-09 08:49:42 -05:00
Roll back the dist-tag:
2026-03-09 08:49:42 -05:00
2026-03-09 13:55:30 -05:00
```bash
./scripts/rollback-latest.sh YYYY.M.D
2026-03-09 13:55:30 -05:00
```
2026-03-09 08:49:42 -05:00
Then fix forward with a new stable release.
2026-03-09 08:49:42 -05:00
## Related Files
2026-03-09 08:49:42 -05:00
- [`scripts/release.sh`](../scripts/release.sh)
- [`scripts/release-package-map.mjs`](../scripts/release-package-map.mjs)
- [`scripts/create-github-release.sh`](../scripts/create-github-release.sh)
- [`scripts/rollback-latest.sh`](../scripts/rollback-latest.sh)
- [`doc/PUBLISHING.md`](PUBLISHING.md)
- [`doc/RELEASE-AUTOMATION-SETUP.md`](RELEASE-AUTOMATION-SETUP.md)