This document details the release process for Tres packages in the monorepo.
The release process is split into two main steps:
- Versioning: Increment versions and create version commits
- Publishing: Build and publish packages to npm with appropriate distribution tags
This separation allows for better control and review of version changes before they are published.
There are two ways to handle versioning, depending on your needs:
To create a release with automatic version increments and a GitHub release:
pnpm nx release --skip-publishTo create a release with automatic version increments and a GitHub release, but only for a specific group of packages:
pnpm nx release --skip-publish --group=coreThis will:
- Analyze conventional commits since the last release
- Determine appropriate version bumps
- Create version commits
- Create git tags
- Push changes to the repository
- Generate changelogs
- Create a GitHub release
For release candidates or silent releases, use the version command:
pnpm nx release versionThis will:
- Analyze conventional commits since the last release
- Determine appropriate version bumps
- Create version commits
- Create git tags
- Push changes to the repository
- Generate changelogs
- Skip creating a GitHub release
To create a release with a specific version:
# With GitHub release
pnpm nx release 1.2.3 --skip-publish
# Without GitHub release
pnpm nx release version 1.2.3Version increments are determined by commit messages:
feat:→ minor version bumpfix:→ patch version bumpBREAKING CHANGE:orfeat!:→ major version bump
After versioning and pushing your changes:
- Go to the GitHub Actions tab
- Select the "Publish" workflow
- Click "Run workflow"
- Select the branch where you pushed your version commit
- Click "Run workflow"
The publish workflow will:
- Build all packages
- Handle workspace dependencies
- Publish to npm with the appropriate distribution tag:
mainbranch →latesttagnextbranch →nexttagbetabranch →betatagalphabranch →alphatag
Users can install specific versions using the appropriate tag:
# Latest stable version
npm install @tresjs/package
# Next version
npm install @tresjs/package@next
# Beta version
npm install @tresjs/package@beta
# Alpha version
npm install @tresjs/package@alphaThe repository uses different branches for different types of releases:
main: Stable releasesnext: Next version releasesbeta: Beta releasesalpha: Alpha releases
Each branch corresponds to a specific npm distribution tag, ensuring users can install the appropriate version for their needs.
- Always run versioning commands from the target branch
- Review version commits before pushing
- Ensure all tests pass before publishing
- Use conventional commits for automatic versioning
- Document breaking changes in commit messages
- Test the published package before announcing the release
- Use
nx release versionfor release candidates or when you don't want to create a GitHub release - Use
nx release --skip-publishfor full releases that should be announced via GitHub