release 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
release 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
release 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT License
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
地区 不详
投 递 者 首席测试
适用人群 未知
收录时间 2021-12-02


Build Status Join the community on GitHub Discussions

When run, this command line interface automatically generates a new GitHub Release and populates it with the changes (commits) made since the last release.


Firstly, install the package from npm (you'll need at least Node.js 7.6.0):

npm install -g release

Alternatively, you can use Yarn to install it:

yarn global add release

Once that's done, you can run this command inside your project's directory:

release <type>

As you can see, a <type> argument can be passed. If you leave it out, a GitHub Release will be created from the most recent commit and tag.

According to the SemVer spec, the argument can have one of these values:

  • major: Incompatible API changes were introduced
  • minor: Functionality was added in a backwards-compatible manner
  • patch: Backwards-compatible bug fixes were applied

In addition to those values, we also support creating pre-releases like 3.0.0-canary.1:

release pre

You can also apply a custom suffix in place of "canary" like this:

release pre <suffix>

Assuming that you provide "beta" as the <suffix> your release will then be 3.0.0-beta.1 – and so on...


The following command will show you a list of all available options:

release help

Pre-Defining Types

If you want to automate release even further, specify the change type of your commits by adding it to the title or description within parenthesis:

Error logging works now (patch)

Assuming that you've defined it for a certain commit, release won't ask you to set a type for it manually. This will make the process of creating a release even faster.

To pre-define that a commit should be excluded from the list, you can use this keyword:

This is a commit message (ignore)

Custom Hook

Sometimes you might want to filter the information that gets inserted into new releases by adding an intro text, replacing certain data or just changing the order of the changes.

With a custom hook, the examples above (and many more) are very easy to accomplish:

By default, release will look for a file named release.js in the root directory of your project. This file should export a function with two parameters and always return a String (the final release):

module.exports = async (markdown, metaData) => {
	// Use the available data to create a custom release
	return markdown;

In the example above, markdown contains the release as a String (if you just want to replace something). In addition, metaData contains these properties:

Property Name Content
changeTypes The types of changes and their descriptions
commits A list of commits since the latest release
groupedCommits Similar to commits, but grouped by the change types
authors The GitHub usernames of the release collaborators

Hint: You can specify a custom location for the hook file using the --hook or -H flag, which takes in a path relative to the current working directory.


As we at Vercel moved all of our GitHub repositories from keeping a file to using GitHub Releases, we needed a way to automatically generate these releases from our own devices, rather than always having to open a page in the browser and manually add the notes for each change.


You can find the authentication flow here.

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Uninstall the package if it's already installed: npm uninstall -g release
  3. Link the package to the global module directory: npm link
  4. You can now use release on the command line!

As always, you can use npm test to run the tests and see if your changes have broken anything.


Thanks a lot to Daniel Chatfield for donating the "release" name on npm and my lovely team for telling me about their needs and how I can make this package as efficient as possible.


Leo Lamprecht (@notquiteleo) - Vercel



评论 (0)

2013/10/31 16:13


目前在JAVA的世界中,maven已经成为事实上的构建标准,很多开源库的管理构建也是基于maven的,我们公司内部的Java代码也完全是使用maven构建的,maven本身的学习曲线比较陡峭,有很多约定和配置。本次我先描述下,关于版本的定义的选择,SNAPSHOT or RELEASE? SNAPSHOT版本是指以-SNAPSHOT为结束的版本号,比如1.0.0-SNAPSHOT,对于SNAPSHOT版本的代码库可以再次发布deploy到maven仓库,所有引用这个版本开源库的项目可以直接重...

2013/01/21 19:22

auto release pool 应该用release还是drain

文档里是这么说的: drain In a reference-counted environment, releases and pops the receiver; in a garbage-collected environment, triggers garbage collection if the memory allocated since the last collection is greater than the current threshold. - (void)drain Discussion In a reference-counted environment, this method behaves the same as release. Since an autorelease pool cannot be retained (see...

2015/12/16 23:37

Maven release插件打tag,发布release版到nexus

一、背景 SNAPSHOT为快照版,不稳定,开发时使用的版本,当测试稳定后,可发布RELEASE版 下面介绍下,本次实验环境: Maven 3.3.1 nexus 2.11.1 Subversion 1.8.x 注意:SVN Connector与Subversion(主要是因为BIN目录包含了一些SVN客户端的命令程序)版本需一致 Eclipse Mar(目前发现SVN的图标,比如未同步图标等,不知道为什么不能显示,这个先不管) 二、步骤 2.1 新建Maven项目 怎么建就不过多说明了,这个相信大家都已经知道了...

0 评论
0 收藏