Releasing packages
How the published npm packages (both git libraries and the CLI) get versioned, tagged and published with trusted publishing.
Three workspaces are published to npm:
| Workspace | Package | Tags |
|---|---|---|
packages/git-fs-s3 | git-fs-s3 | git-fs-s3@v* |
packages/git-edge | git-edge | git-edge@v* |
apps/cli | @pushstack/cli | @pushstack/cli@v* |
apps/web, apps/docs and packages/tsconfig are private: the app and the docs
site deploy from the repository, and the TypeScript configuration is consumed
through the workspace.
Cutting a release
-
Bump the version in the workspace's
package.json. -
Add the release to its
CHANGELOG.md(Keep a Changelog format, newest first). Replace theunreleasedheading with the version and the date. -
Commit, then push an annotated tag (
git tag -m, never a lightweight one — the repository's git configuration rejects message-less tags):git tag -m "git-fs-s3 v0.16.0" git-fs-s3@v0.16.0 git push origin git-fs-s3@v0.16.0 -
.github/workflows/release-packages.ymldoes the rest: it resolves the tag's package name to its workspace (scripts/workspace-directory.mjs), checks the tag against the version inpackage.json, runsturbo run typecheck test build --filter=<package>, packs withpnpm pack(which rewritesworkspace:*ranges to real versions), publishes the tarball withnpm publish --provenance, and opens a GitHub release.
Never delete or move a pushed tag. A published version cannot be
re-published; release a new patch instead. A tag whose version does not match
package.json fails the workflow before anything is packed.
Trusted publishing, not tokens
There is no NPM_TOKEN anywhere in this repository. Each package's npm settings
list this repository and release-packages.yml as its trusted publisher, and
the workflow authenticates through OIDC (id-token: write), so npm trusts the
run itself and attaches a provenance attestation that points back at the exact
commit and workflow that built the tarball.
Because no token is involved, setup-node is used without registry-url:
a generated .npmrc would reference NODE_AUTH_TOKEN, which nothing sets.
The workflow installs the latest npm CLI instead, which trusted publishing
requires (npm 11.5.1 or newer).
Adding a fourth publishable workspace means:
- adding its
@v*tag pattern torelease-packages.yml'son.push.tags; - a
package.jsonwith afileslist that includes the built output, andpublishConfig.access: "public"for scoped names; - configuring the trusted publisher on npmjs.com for that package;
- nothing else: the workspace directory is resolved by package name, and the version check, test run, pack and publish are shared.