UNPKG

2.47 kBMarkdownView Raw
1# grunt-release
2[Grunt](http://gruntjs.com) plugin for automating all the release steps of your node lib or bower component, with optional publishing to npm.
3
4## Repetition Killed the Cat
5Releasing a new version of your killer Node lib looks like this:
6
71. bump the version in your `package.json` file.
82. stage the package.json file's change.
93. commit that change with a message like "release 0.6.22".
104. create a new git tag for the release.
115. push the changes out to github.
126. also push the new tag out to github.
137. publish the new version to npm.
14
15Cool, right? No! What's wrong with you? Automate all that:
16
17```shell
18grunt release
19```
20
21Done. No more github issues reminding you how often you forget to do one or more of the steps.
22
23## Setup
24If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
25
26```shell
27npm install grunt-release --save-dev
28```
29
30Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
31
32```js
33grunt.loadNpmTasks('grunt-release');
34```
35
36## Using grunt-release
37
38**Patch Release:**
39```shell
40grunt release
41```
42or
43```shell
44grunt release:patch
45```
46
47**Minor Release:**
48```shell
49grunt release:minor
50```
51
52**Major Release:**
53```shell
54grunt release:major
55```
56
57## Options
58You can disable any of the steps if you want, by adding this to your Gruntfile:
59
60```js
61 release: {
62 options: {
63 bump: false, //default: true
64 file: 'component.json', //default: package.json
65 add: false, //default: true
66 commit: false, //default: true
67 tag: false, //default: true
68 push: false, //default: true
69 pushTags: false, //default: true
70 npm: false, //default: true
71 tagName: 'some-tag-<%= version %>', //default: '<%= version %>'
72 commitMessage: 'check out my release <%= version %>', //default: 'release <%= version %>'
73 tagMessage: 'tagging version <%= version %>' //default: 'Version <%= version %>'
74 }
75 }
76```
77For node libs, leave `file` option blank. For bower components, set it to `component.json` or whatever you've set your bower config file to be.
78
79## Credits
80Inspired by Vojta Jina's [grunt-bump](https://github.com/vojtajina/grunt-bump).
81
82## License
83MIT
\No newline at end of file