This document explains how to release a new version of @permify/permify-node to NPM.
The release process is fully automated using GitHub Actions. When you create a GitHub release, the package is automatically published to NPM.
Make sure everything is ready:
# Pull latest changes
git checkout main
git pull origin main
# Run tests
yarn run-test
# Build the project
yarn buildFollow Semantic Versioning:
- MAJOR (x.0.0) - Breaking changes
- MINOR (0.x.0) - New features (backward compatible)
- PATCH (0.0.x) - Bug fixes
Examples:
1.1.1→1.1.2(bug fix)1.1.2→1.2.0(new feature)1.2.0→2.0.0(breaking change)
- Go to Releases
- Click "Draft a new release"
- Fill in the details:
- Tag version:
v1.2.0(must start withv) - Release title:
v1.2.0 - Description: List changes, new features, and bug fixes
- Tag version:
- Click "Publish release"
Once published, GitHub Actions will:
- Build the package
- Extract version from tag (e.g.,
v1.2.0→1.2.0) - Update
package.jsonversion - Publish to NPM
Track progress at: https://github.com/Permify/permify-node/actions
Check that the new version is live:
npm view @permify/permify-node versionProto definitions are automatically synced from Buf Schema Registry.
The proto workflow runs on every push to main:
- Generates TypeScript code from latest proto definitions
- Creates a pull request if changes are detected
- PR branch:
proto-update/permify-latest
To manually update protos:
yarn buf:generatePublishing uses npm trusted publishing, so no long-lived npm publish token is required.
Configure the trusted publisher in the npm package settings:
- Publisher: GitHub Actions
- Organization or user:
Permify - Repository:
permify-node - Workflow filename:
publish.yml - Allowed actions:
npm publish - Environment name: leave empty unless
.github/workflows/publish.ymlis updated to use a matching GitHub environment
Trigger: GitHub release published
Steps:
- Checkout code
- Setup Node.js with npm trusted publishing support
- Install dependencies
- Build (
yarn build) - Update version
- Publish to NPM using GitHub OIDC
Trigger: Push to main or manual dispatch
Steps:
- Setup Buf CLI
- Generate TypeScript code
- Create PR if changes detected
# Test locally
yarn build- Verify the npm trusted publisher settings match
Permify/permify-nodeandpublish.yml - Check that the workflow has
id-token: writepermission - Verify version doesn't already exist on NPM
- Check Actions logs
If you published the wrong version:
- Delete the GitHub release
- Delete the Git tag:
git tag -d v1.2.0 git push origin :refs/tags/v1.2.0
- Unpublish from NPM (within 24 hours):
npm unpublish @permify/permify-node@1.2.0
Note: After 24 hours, you cannot unpublish. Release a new patch version instead.
Before releasing:
- All tests pass
- Code reviewed and merged
- Version number follows semantic versioning
- Release notes prepared
- Breaking changes documented (if any)
- npm trusted publisher is configured for
.github/workflows/publish.yml