Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
chore(release): add tasks "grunt version" and "grunt version:patch" t…
Browse files Browse the repository at this point in the history
…o create release tags
  • Loading branch information
rishibaldawa committed Jul 1, 2015
1 parent 16d639f commit 1be1380
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -41,6 +41,7 @@
"browserid-crypto": "^0.7.0",
"eslint-config-fxa": "^1.8.0",
"grunt": "^0.4.5",
"grunt-bump": "0.3.1",
"grunt-cli": "^0.1.13",
"grunt-conventional-changelog": "^1.1.0",
"grunt-copyright": "^0.2.0",
Expand Down
25 changes: 25 additions & 0 deletions tasks/bump.js
@@ -0,0 +1,25 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// takes care of bumping the version number in package.json

module.exports = function (grunt) {
'use strict';

grunt.config('bump', {
options: {
files: ['package.json', 'npm-shrinkwrap.json'],
bumpVersion: true,
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json', 'npm-shrinkwrap.json', 'CHANGELOG'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: false,
pushTo: 'origin',
gitDescribeOptions: '--tags --always --abrev=1 --dirty=-d'
}
});
};
31 changes: 31 additions & 0 deletions tasks/version.js
@@ -0,0 +1,31 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

//
// A task to stamp a new version.
//
// Before running this task you should update CHANGELOG with the
// changes for this release. Protip: you only need to make changes
// to CHANGELOG; this task will add and commit for you.
//
// * version is updated in package.json
// * git tag with version name is created.
// * git commit with updated package.json created.
//
// NOTE: This task will not push this commit for you.
//

module.exports = function (grunt) {
'use strict';

grunt.registerTask('version', [
'bump-only:minor',
'bump-commit'
]);

grunt.registerTask('version:patch', [
'bump-only:patch',
'bump-commit'
]);
};

0 comments on commit 1be1380

Please sign in to comment.