Interactive release tool for Git repositories. Options: run build command first, release to distribution repository (or branch), create GitHub release, publish to npm.
Automatically bump version, commit, tag, push, done.
Here's an extended article about Using Release It!
Obviously, Release It has released itself. Cool, heh?! There's also a Grunt plugin.
npm install release-it -g
Release a new patch (increments from e.g.
Release a patch, minor, major, or specific version:
release-it minorrelease-it 0.8.3release-it 2.0.0-rc.3
Create a pre-release using
release-it premajor --prereleaseId="beta"release-it premajor
The first example would increment from e.g.
2.0.0-beta.0, the second from
See node-semver for more details.
You can also do a dry run, which won't write/touch anything, but does output the commands it would execute, and show the interactivity:
If you don't like questions and trust the tool, you can use the
Provide a custom name for the GitHub release:
release-it --github.releaseName="Awesome Ants"
Release It can do a lot out-of-the-box, but has plenty of options to configure it.
$ release-it --helpRelease It! v2.1.0Usage: release <increment> [options]Use e.g. "release minor" directly as shorthand for "release --increment=minor".Options:-c, --config Path to local configuration options [default: ".release.json"]-d, --dry-run Do not touch or write anything, but show the commands and interactivity-e, --debug Output exceptions-f, --force Force tagging with Git-h, --help Print help-i, --increment Increment "major", "minor", "patch", or "pre*" version; or specify version [default: "patch"]-m, --message Commit message [default: "Release %s"]-n, --non-interactive No interaction (assume default answers to questions)--prereleaseId Identifier for pre-releases (e.g. "beta" in "1.0.0-beta.1")-p, --npm.publish Auto-publish to npm (only relevant in --non-interactive mode)--npm.tag Register published package with given tag (default: "latest")-v, --version Print version number-V, --verbose Verbose output
src.pushRepohas a falsey value, just
git pushis used. Otherwise, it's the url or name of a remote in
git push <src.pushRepo>.
dist.pkgFileshas a falsey value, it will take the value of
after*/before*commands are executed from the root/working directory of the source or distribution repository. The
beforeStageCommandis executed before files are staged for commit, and after a version bump.
Some projects use a special distribution repository. There might be multiple reasons to do.
dist.repoto a git endpoint (e.g.
dist.repo, but still want to publish the source repository to npm, make sure to set
The tool assumes you've configured your SSH keys and remotes correctly. In case you need to configure things for GitHub, the following pages might be of help.
To create GitHub releases, you'll need to set
true, get a GitHub access token, and make this available as the environment variable defined with
github.tokenRef. With the default settings, you could set it like this:
In non-interactive mode, the release is created only for the source repository.
.release.json file in your project root, and Release It will use it to overwrite default settings. You can use
--config if you want to use another filename/location. Most options can be set on the command-line (these will have highest priority).
To keep you in control, many steps need your confirmation before execution. This is what happens if you answer "Yes" to each question:
With the current repository:
dist.baseDirand execute the
%sis replaced with the new version).
github.releaseNameand output of
dist.repo? Publish package to npm.
Additionally, if a distribution repository is configured:
dist.pkgFiles, commit, tag, push
github.releaseNameand output of
"private": truesetting in package.json will be respected and you will not be bothered with the question to publish to npm.
The following Grunt plugins have been a source of inspiration:
Why did I need to create yet another "release" tool/plugin? I think this tool stands out: