Skip to content

Commit 489b473

Browse files
author
Zeno Rocha
committed
Add bump/release tasks
1 parent 6496f50 commit 489b473

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Gruntfile.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = function(grunt) {
33
grunt.initConfig({
44

55
pkg: grunt.file.readJSON('package.json'),
6+
67
meta: {
78
banner: '/*\n' +
89
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n' +
@@ -13,6 +14,21 @@ module.exports = function(grunt) {
1314
' * MIT License\n' +
1415
' */\n'
1516
},
17+
18+
bump: {
19+
options: {
20+
files: ['bower.json', 'package.json'],
21+
commit: true,
22+
commitMessage: 'Release v%VERSION%',
23+
commitFiles: ['bower.json', 'package.json'],
24+
createTag: true,
25+
tagName: '%VERSION%',
26+
tagMessage: '',
27+
push: true,
28+
pushTo: 'origin'
29+
}
30+
},
31+
1632
concat: {
1733
options: {
1834
banner: '<%= meta.banner %>'
@@ -70,6 +86,7 @@ module.exports = function(grunt) {
7086

7187
});
7288

89+
grunt.loadNpmTasks('grunt-bump');
7390
grunt.loadNpmTasks('grunt-contrib-concat');
7491
grunt.loadNpmTasks('grunt-contrib-jasmine');
7592
grunt.loadNpmTasks('grunt-contrib-jshint');
@@ -78,6 +95,7 @@ module.exports = function(grunt) {
7895
grunt.loadNpmTasks('grunt-lintspaces');
7996

8097
grunt.registerTask('default', ['lintspaces', 'jshint', 'concat', 'uglify']);
98+
grunt.registerTask('release', ['bump-only:patch', 'default', 'bump-commit']);
8199
grunt.registerTask('test', ['lintspaces', 'jshint', 'jasmine']);
82100

83101
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"grunt": "~0.4.1",
14+
"grunt-bump": "~0.0.13",
1415
"grunt-cli": "~0.1.7",
1516
"grunt-contrib-concat": "~0.3.0",
1617
"grunt-contrib-jasmine": "~0.5.1",

0 commit comments

Comments
 (0)