Automatic generator of version numbers for releases & prereleases
Quick Release analyzes a project's version number, commit history, and version tags to determine the version to use for the next release.
Quick Release analyzes the following data to determine the next version number:
- the current version in
package.json
- the commit messages since the last stable-release tag
- release and prerelease version tags
- the branch name
The master
branch is treated as the stable-release branch. A version bump on this branch
results in a new version number in the form X.X.X
(example: 1.0.0
).
If the stable-release branch has a name other than master
, set it using the STABLE_RELEASE_BRANCH
environment variable in each of the workflow files. Note that the use of master
is deprecated,
and main
will become the default stable-release branch name in a future version of this library.
All branches other than the stable-release branch are treated as prerelease branches. A version bump
on a prerelease branch results in a new version number in the form X.X.X-<BRANCH NAME>.X
(example: 1.0.0-beta.1
).
$ yarn add --dev @skypilot/quick-release
# or
$ npm add --save-dev @skypilot/quick-release
Quick Release exposes six commands:
-
bump-version
: Computes the next version number for your project and writes it topackage.json
-
get-current-version
: Displays your project's current version number frompackage.json
-
get-next-version
: Computes the next version number for your project and displays it to standard output -
is-published VERSION
: Returns true if the version has been published, otherwise false -
is-tagged VERSION
turns true if the version tag has been used, otherwise false -
spqr-option KEY
: Returns the value mapped to a key in the.skypilot/quick-release.yaml
options file. If no value is set there, it defaults to the value in the defaults file.
See the files in .github/workflows
in this repo for examples of how to use Quick Release in a
GitHub Actions workflow (Quick Release is used for its own releases).
- Major change (X.x.x):
CHG!, DROP!, MAJOR, MAJOR!
- Minor change (x.X.x):
add, chg, drop, feat, minor
- Patch change (x.x.X):
- Fixes:
bug, fix, patch
- Refactoring:
chore, refactor, task
- Internal features:
util
- Other: no prefix
- Fixes:
- No change (patch change if released):
- Documentation & code style:
docs, style
- Documentation & code style:
These values will soon be customizable.
Quick Release checks for a configuration file at .skypilot/quick-release.yaml
in your project's
root directory; the settings in that file can be used to customize Quick Release's behaviour.
See the defaults file for available settings.
The library also exposes the following functions:
getCoreVersion(): string
getCurrentVersion(): string
parseMessageChangeLevel(message: string): ChangeLevel
parseMessagesChangeLevel(messages: string[]): ChangeLevel
These features are slated for development in the near future:
- Changelog generation
- Automated creation of GitHub Releases