This document outlines the process for publishing new versions of the @txnlab/nfd-sdk package.
We use GitHub Actions to automate the publishing process. The workflow is triggered either:
- Automatically when pushing to specific branches (
main,alpha,beta,next) - Manually through the GitHub UI
-
Make your changes and commit them with semantic commit messages:
feat:for new features (triggers a minor version bump)fix:for bug fixes (triggers a patch version bump)- Include
BREAKING CHANGE:in the commit body for breaking changes (requires manual version tag)
-
Push to a publishing branch:
mainbranch: Regular releases (latest tag)nextbranch: Next releases (next tag)betabranch: Beta releases (beta tag)alphabranch: Alpha releases (alpha tag)
-
The workflow will:
- Build and test the package
- Determine the appropriate version bump based on commit messages
- Update the package.json version
- Publish to npm
- Create a git tag
- Create a GitHub release with a changelog
- Go to the "Actions" tab in the GitHub repository
- Select the "Publish Package" workflow
- Click "Run workflow"
- Configure the workflow:
- Optionally provide a specific version tag (e.g.,
v1.0.0) for manual versioning - Optionally specify a branch to publish from (defaults to the current branch)
- Optionally provide a specific version tag (e.g.,
- Click "Run workflow"
The following secrets must be configured in your GitHub repository:
NPM_TOKEN: An npm access token with publish permissions for the @txnlab organization
The package version is determined by:
- If a manual tag is provided (e.g.,
v1.0.0), that version will be used - Otherwise, the version is determined based on commit messages since the last tag:
feat:commits trigger a minor version bumpfix:,refactor:,perf:commits trigger a patch version bump- Commits with
BREAKING CHANGE:in the body require a manual version tag
For the first release, you need to provide a manual tag since there's no previous tag to compare against:
- Go to the "Actions" tab in the GitHub repository
- Select the "Publish Package" workflow
- Click "Run workflow"
- Enter
v0.1.0(or your desired initial version) in the "Override release tag" field - Click "Run workflow"
mainbranch: Regular releases (latest)nextbranch: Next releases (next)betabranch: Beta releases (beta)alphabranch: Alpha releases (alpha)