This document outlines the release process for the Nuxt UTM module.
We follow a PR-based release process that works with protected branches:
flowchart TD
A[Create release branch] --> B[Run yarn release:prepare]
B --> C[Commit and push branch]
C --> D[Open PR to main]
D --> E[PR Review and Merge]
E --> F{Version tag exists?}
F -->|No| G[Create git tag]
G --> H[Create GitHub Release]
H --> I[Publish to NPM]
F -->|Yes| J[Skip release]
-
Create a Release PR:
- Version bump in
package.json - CHANGELOG update
- Open PR for review
- Version bump in
-
Automated Release (GitHub Actions):
- Triggered automatically when the PR is merged to main
- Detects the new version and creates a git tag
- Creates a GitHub Release
- Publishes the package to NPM
-
Ensure you have the latest changes from the main branch:
git checkout main git pull origin main
-
Create a release branch:
git checkout -b release-X.Y.Z
-
Make sure all tests pass:
yarn test -
Run the release script, which will:
- Bump the version in
package.json - Update the
CHANGELOG.md
yarn release:prepare
- Bump the version in
-
Commit and push the release branch:
git add . git commit -m "chore: release vX.Y.Z" git push -u origin release-X.Y.Z
-
Open a Pull Request to
mainand get it reviewed. -
Once the PR is merged, the CI will automatically:
- Detect the new version
- Create a git tag (
vX.Y.Z) - Create a GitHub Release
- Trigger the NPM publish workflow
The release-on-merge.yml workflow runs on every push to main that modifies package.json. It:
- Reads the version from
package.json - Checks if a git tag for that version already exists
- If no tag exists, creates the tag and a GitHub Release
- The GitHub Release triggers the npm-publish.yml workflow
We follow Semantic Versioning for this project:
- MAJOR version for incompatible API changes
- MINOR version for backwards-compatible functionality additions
- PATCH version for backwards-compatible bug fixes
If the automated release fails:
- Check the GitHub Actions logs for errors
- Ensure the
npm_tokensecret is correctly set in the repository settings - Verify that the version in
package.jsonhasn't already been published - If the release workflow failed but the tag was created, you can manually trigger the
npm-publishworkflow
If a release was skipped:
- The workflow only runs when
package.jsonis modified - Check if the git tag already exists for the version
- You can manually trigger the release by creating a GitHub Release
- The release process uses changelogen to generate CHANGELOG entries
- Always verify that the published package works correctly by installing it in a test project
- The main branch is protected; all releases must go through a PR
For questions or assistance with the release process, please contact the maintainers or email community@stackbuilders.com.