Appearance
Release and maintenance
@0-auth/zero-auth publishes from GitHub Releases. A published GitHub release triggers its npm workflow; do not run a second manual npm publish for the same version. The IdP packages use the explicit package selector described below.
IdP and MongoDB adapter releases
WARNING
Do not create a GitHub Release to publish an IdP package: the current release event always selects @0-auth/zero-auth. Use the Publish to npm workflow's package selector instead. Existing package versions must remain unchanged.
For @0-auth/zero-auth-idp-mongodb@0.1.0:
Date the adapter changelog and keep any migration warning at the start of its README. Confirm the version in its manifest, build banner, and lockfile agree.
Build the IdP dependency, then run the adapter's release checks:
bashnpm run build --workspace @0-auth/zero-auth-idp npm run prepublishOnly --workspace @0-auth/zero-auth-idp-mongodb npm run test:coverage --workspace @0-auth/zero-auth-idp-mongodb npm run test:integration --workspace @0-auth/zero-auth-idp-mongodb npm pack --workspace @0-auth/zero-auth-idp-mongodbSet
MONGODB_URIfor the integration tests; without it, they are skipped. Install the resulting tarball outside the monorepo with the published IdP peer and MongoDB driver 6. Check CommonJS, ESM, TypeScript declarations, and real storage operations. Do not substitute workspace links for this check.Commit and push the release preparation, then wait for CI to pass. Obtain publishing approval before dispatching:
bashgh workflow run publish.yml --ref master -f package=zero-auth-idp-mongodbWait for that workflow to succeed, verify
npm view @0-auth/zero-auth-idp-mongodb@0.1.0 version dist.tarball, and repeat the clean consumer check using the registry version. Do not also publish from the local terminal.Only after publication, remove repository "not published yet" notes and switch the Express IdP example's
file:dependencies to npm versions. Regenerate its lockfile and rerun its end-to-end test before committing those changes.
The same dispatch path applies to @0-auth/zero-auth-idp with -f package=zero-auth-idp. The remaining sections describe the original @0-auth/zero-auth release process.
Before a release
- Confirm the working tree is clean except for the intended changes.
- Update the package version in
packages/zero-auth/package.jsonandpackage-lock.json. - Add the release entry to
packages/zero-auth/CHANGELOG.md. - Put breaking changes and upgrade steps at the start of
packages/zero-auth/README.md. - Update examples and API-facing documentation.
- Run the complete local gate:
bash
npm run format:check
npm run lint
npm run typecheck
npm run test:coverage
npm run build
npm run docs:build
npm pack --workspace @0-auth/zero-auth --dry-runRun both examples when their dependencies are available:
bash
cd examples/express-rest-api
npm test
cd ../express-cookies-redis
npm testCommit and push
Use a focused conventional commit and push the branch used by CI:
bash
git status
git add .
git commit -m "release: vX.Y.Z"
git push origin masterWait for the normal CI workflow to pass before creating the release.
Create the GitHub release
Create a tag that points at the verified commit:
bash
gh release create vX.Y.Z \
--target master \
--title "vX.Y.Z" \
--notes-file release-notes.mdThe release notes should summarize user-visible changes, migrations, security implications, and links to the changelog. Use the version without a leading v in package.json and the leading v for the Git tag.
Verify publication
Check all three sources:
bash
gh run list --workflow publish.yml --limit 1
npm view @0-auth/zero-auth version
npm view @0-auth/zero-auth@X.Y.Z dist.tarballThen test a clean consumer installation:
bash
mkdir /tmp/zero-auth-release-check
cd /tmp/zero-auth-release-check
npm init -y
npm install @0-auth/zero-auth@X.Y.Z expressImport both module formats and exercise token generation, verification, and the public middleware API.
Documentation publishing
The package documentation source lives in packages/zero-auth/README.md and packages/zero-auth/CHANGELOG.md. Repository and site documentation lives in docs/. Generated TypeDoc output lives in docs/api/ and is intentionally ignored. It is rebuilt by npm run docs:build and should not be edited by hand.
The npm tarball includes the package README, changelog, license, compiled builds, and TypeScript declarations. The full VitePress site is maintained from the repository docs/ directory.
Rollback
If the release is faulty:
- Stop promoting the release in application deployments.
- Publish a corrective patch version; do not overwrite an npm version.
- Document the issue and migration in the next changelog entry.
- If secrets or refresh state are affected, rotate them or revoke the affected token families.
Never reuse a released version number.