autorelease

Automatically release NPM packages based on commit messages.

Stats

StarsIssuesVersionUpdatedCreatedSize
autorelease
311.7.16 years ago6 years agoMinified + gzip package size for autorelease in KB

Readme

Autorelease

npm David Build Status

This is a tool to facilitate the releasing of NPM packages based on Git commit messages. This tool is designed to handled all aspects of publishing Node modules, including:

  • Release verification to ensure the environment is configured correctly before publishing.
  • Bumping package versions using semver according to commit types.
  • Generating changelogs from commit messages.
  • Tagging the commit in Git with the new version.

This is tool is highly configurable and can be adapted using plugins for almost any environment.

This is very similar to semantic-release, but it is much less opinionated. By default, this library does not assume you are using any specific remote git repository host or continuous integration platform. You can configure this tool to work with the environment of your choosing.

Install

Install using NPM:

npm i autorelease --save-dev

You can also easily setup your package for Github or Gitlab using the autorelease-setup cli. That will take you through a series of prompts and install the correct autorelease packages, including plugins.

npm i autorelease-setup -g
autorelease-setup

Basic Usage

This CLI tool is split into two parts, a before release (pre) stage and an after release (post) stage, each with a series of steps. The before release sets up the repository for release, including release verification, bumping the version number and configuring NPM. The after release stage handles changelog generation and git tagging. The steps in these stages can be configured using the .autoreleaserc file.

To release a module using this tool, add the following to you package.json after installing.

{
    "scripts": {
        "autorelease": "autorelease pre && npm publish && autorelease post"
    }
}

You will also need to generate an NPM token, either by using npm login or with a package like get-npm-token. Set the token to the NPM_TOKEN environment variable.

export NPM_TOKEN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Now you can release your package from the command line with:

npm run autorelease

Plugins

There are currently a handful of plugins for Autorelease to configure it for common environments.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.