docs/pre-releases.md
With release-it, it's easy to create pre-releases: a version of your software that you want to make available, while it's not in the stable semver range yet. Often "alpha", "beta", and "rc" (release candidate) are used as identifier for pre-releases.
An example. The awesome-pkg is at version 1.3.0, and work is done for a new major update. To publish the latest beta
of the new major version:
release-it major --preRelease=beta
This will tag and release version 2.0.0-beta.0. Notes:
npm install of awesome-pkg will still be at version 1.3.0.npm install awesome-pkg@betaThe above command is actually a shortcut for:
release-it premajor --preReleaseId=beta --npm.tag=beta --github.preRelease
Consecutive beta releases (2.0.0-beta.1 and so on):
release-it --preRelease
And when ready to release the next phase (e.g. release candidate, in this case 2.0.0-rc.0):
release-it --preRelease=rc
And eventually, for 2.0.0:
release-it major
When all commits since the latest major tag should be added to the changelog, use --git.tagExclude:
release-it major --git.tagExclude='*[-]*'
This will find the latest major matching tag, excluding the pre-release tags, which normally include - in their name.
Let's go back to when the latest release was 2.0.0-rc.0. We added new features, which we don't want in the v2 release
yet, but instead in a later v2.1. A new pre-release id can be made for the minor release after in 2.1.0-alpha.0:
release-it preminor --preRelease=alpha
Use --preReleaseBase=1 to start counting at 1. The first example at 1.3.0 will now bump to 2.0.0-beta.1 instead:
release-it major --preRelease=beta --preReleaseBase=1
Notes:
release-it --preRelease=rc --npm.tag=next.