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
|
5 | Releasing a new version of your killer Node lib looks like this:
|
6 |
|
7 | 1. bump the version in your `package.json` file.
|
8 | 2. stage the package.json file's change.
|
9 | 3. commit that change with a message like "release 0.6.22".
|
10 | 4. create a new git tag for the release.
|
11 | 5. push the changes out to github.
|
12 | 6. also push the new tag out to github.
|
13 | 7. publish the new version to npm.
|
14 |
|
15 | Cool, right? No! What's wrong with you? Automate all that:
|
16 |
|
17 | ```shell
|
18 | grunt release
|
19 | ```
|
20 |
|
21 | Done. No more github issues reminding you how often you forget to do one or more of the steps.
|
22 |
|
23 | ## Setup
|
24 | If 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
|
27 | npm install grunt-release --save-dev
|
28 | ```
|
29 |
|
30 | Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
|
31 |
|
32 | ```js
|
33 | grunt.loadNpmTasks('grunt-release');
|
34 | ```
|
35 |
|
36 | ## Using grunt-release
|
37 |
|
38 | **Patch Release:**
|
39 | ```shell
|
40 | grunt release
|
41 | ```
|
42 | or
|
43 | ```shell
|
44 | grunt release:patch
|
45 | ```
|
46 |
|
47 | **Minor Release:**
|
48 | ```shell
|
49 | grunt release:minor
|
50 | ```
|
51 |
|
52 | **Major Release:**
|
53 | ```shell
|
54 | grunt release:major
|
55 | ```
|
56 |
|
57 | ## Options
|
58 | You 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 | }
|
72 | }
|
73 | ```
|
74 | For 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.
|
75 |
|
76 | ## Credits
|
77 | Inspired by Vojta Jina's [grunt-bump](https://github.com/vojtajina/grunt-bump).
|
78 |
|
79 | ## License
|
80 | MIT |
\ | No newline at end of file |