From 307f8ade36ced20503e2ac238c11938bfa8537a5 Mon Sep 17 00:00:00 2001 From: vieron Date: Fri, 18 Oct 2013 19:42:38 +0200 Subject: [PATCH] chore(grunt): add grunt-bump to manage releases --- Gruntfile.js | 26 +++++++++++++++++++++++++- package.json | 3 ++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 3b40ce90de..641b382edd 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -131,6 +131,22 @@ module.exports = function(grunt) { } }, + bump: { + options: { + files: ['package.json'], + updateConfigs: ['pkg'], + commit: true, + commitMessage: 'Release v%VERSION%', + commitFiles: ['package.json', 'dist/'], // '-a' for all files + createTag: true, + tagName: 'v%VERSION%', + tagMessage: 'Version %VERSION%', + push: true, + pushTo: 'origin', + gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe' + } + }, + watch: { files: ['libs/*.js', 'src/*.js', 'Gruntfile.js'], tasks: ['concat', 'uglify', 'cssmin'] @@ -144,8 +160,16 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-yuidoc'); + grunt.loadNpmTasks('grunt-bump'); // Default task. - grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'cssmin', 'yuidoc']); + grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'cssmin']); + grunt.registerTask('build', ['default']); + grunt.registerTask('docs', ['yuidoc']); + + grunt.registerTask('release', ['build', 'bump-only:patch', 'build', 'docs', 'bump-commit']); + grunt.registerTask('release:minor', ['build', 'bump-only:minor', 'build', 'docs', 'bump-commit']); + grunt.registerTask('release:major', ['build', 'bump-only:major', 'build', 'docs', 'bump-commit']); + grunt.registerTask('release:git', ['build', 'bump-only:git', 'build', 'docs', 'bump-commit']); }; diff --git a/package.json b/package.json index 8b538f4ba5..a266ea66b7 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "grunt-contrib-cssmin": "~0.5.0", "grunt-contrib-yuidoc": "~0.4.0", "bower": "~0.9.2", - "qunit": "~1.11.0" + "qunit": "~1.11.0", + "grunt-bump": "0.0.11" } }