The CI workflow runs on every pull request to main, pushes to main, merge
queue checks, v* tags, and manual runs from the Actions page. There are no path
filters: documentation-only PRs also report the required check. Like pi-warden,
this project prepares draft releases but does not automatically publish to npm.
- Workflow lint runs actionlint 1.7.12 and ShellCheck on the workflow commands.
- Check (ubuntu-latest, Node 22.19.0) tests the minimum supported Node version.
- Linux also runs Node 24 and 26; macOS runs Node 24. Each job installs
the lockfile with
npm ci, then runsnpm run check: build, typecheck, and offline tests. Build runs first because the public-API example resolves this package's exports throughdist/; this also checks the generated declarations from a clean checkout. Native Windows is not in this matrix; the existing credential and usage tests assert POSIX file permissions. - Package builds an actual npm tarball and installs it outside the checkout
with install scripts disabled. It checks root and calibration imports without
optional Pi peers, verifies all declared JavaScript and type declaration
files, then checks the extension, UI helpers, and Pi loader with the peer
versions from
package-lock.json. It also checks package/lockfile version agreement. - CI passed runs even when another job fails or is skipped, and fails unless
all three prerequisites succeeded. This is the stable check to require in the
mainbranch rules; do not require only Package, which can be skipped.
No TypeSafe or OpenRouter credentials are needed. Tests do not call either
service. CI does not run test:live or any other billable checks. Package
installation needs access to npm; offline tests themselves use fake transports.
Actions use full commit SHAs, checkout does not retain credentials, and check
jobs have read-only repository permissions. Jobs have time limits; newer PR
runs cancel superseded runs. Fork PRs use pull_request, never
pull_request_target, and do not receive repository secrets. Dependabot opens
weekly action and dependency updates; they run the same checks and are not
merged automatically.
Run the normal gate locally with:
npm ci
npm run check
npm pack --dry-run # builds and lists the publishable filesFor the complete installed-package smoke test, use the workflow's Package
steps or dispatch CI from the Actions page after this workflow is on main.
Successful runs retain an npm-package artifact for 14 days. It contains the
verified tarball and SHA256SUMS; tag runs also include release notes.
A tag run must pass the same checks. Before packaging, it must also prove:
- The tagged commit is an ancestor of
origin/main. - The package has a stable
X.Y.Zversion and the tag is exactlyvX.Y.Z. - Both root version fields in
package-lock.jsonmatchpackage.json. CHANGELOG.mdhas a nonempty## X.Y.Zsection, not just an HTML comment.
Only a push of a version tag can start Draft release. The job downloads that run's checked artifact, verifies the tarball checksum, and creates a draft GitHub release with the notes, tarball, and checksum. PRs, branch pushes, merge queues, and manual runs cannot create a release. A manual run on a tag can check it, but does not publish or create a draft.
Only the draft job has contents: write. It uses the built-in GitHub token,
does not check out or execute repository code, and uses --verify-tag so it
cannot create a tag. No npm token or other new repository secret is required.
An existing release for the tag makes creation fail rather than overwrite it;
inspect any existing draft and assets before retrying a failed delivery.
- In GitHub's
mainbranch rules, require CI passed and PR review. This PR does not change repository settings; the checks are not a merge restriction until a maintainer enables the rule. - For a release, update the version with
npm version patch --no-git-tag-version(or the chosen minor version), sopackage.jsonandpackage-lock.jsonstay aligned. Move the release notes below a matching## X.Y.Zheading and leave## Unreleasedat the top. Commit these release files together. Normal contributor PRs leave the version bump to the maintainer. - Merge only after review and a passing CI passed. Pull the merged
main, ensure the checkout is clean, and runnpm ciandnpm run check. - Create and push the matching tag:
git tag vX.Y.Z && git push origin vX.Y.Z. - Wait for its
CIrun and review the draft. Download its tarball andSHA256SUMSto an empty directory, then runsha256sum --check SHA256SUMS(shasum -a 256 --check SHA256SUMSon macOS). - Publish that verified tarball yourself with
npm publish ./pi-typesafe-X.Y.Z.tgz, using maintainer credentials and the normal npm authentication checks. Then publish the GitHub draft manually. Do not publish a PR artifact or runnpm publishfrom an unreviewed branch.
Merging this workflow creates no tag, npm publication, or published GitHub
release. The existing manual npm publish process can still be used from a
reviewed, checked release commit; publishing the tagged tarball is preferred
because it is the exact package tested by the release workflow.