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:generateSet in GitHub repository settings:
- NPM_TOKEN: Authentication token for publishing to NPM
- Create at npmjs.com → Access Tokens
- Type: Automation
- Permission: Read and Write
Trigger: GitHub release published
Steps:
- Checkout code
- Setup Node.js 20
- Install dependencies
- Build (
yarn build) - Update version
- Publish to NPM
Trigger: Push to main or manual dispatch
Steps:
- Setup Buf CLI
- Generate TypeScript code
- Create PR if changes detected
# Test locally
yarn build- Check if
NPM_TOKENis valid - 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_TOKEN is valid