diff --git a/Gruntfile.js b/Gruntfile.js index e8a382e..5569780 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,7 +11,7 @@ module.exports = function(grunt) { concat: { options: { - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n', + banner: '/*! <%= pkg.name %> - version : <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n', }, dist: { @@ -45,6 +45,24 @@ module.exports = function(grunt) { }, }, + bump: { + options: { + files: ['package.json', 'bower.json', 'lib/bem-constructor.rb', 'dist/_bem-constructor.scss'], + updateConfigs: [], + commit: true, + commitMessage: 'Bump version %VERSION%', + commitFiles: ['package.json', 'bower.json', 'lib/bem-constructor.rb', 'dist/_bem-constructor.scss'], + createTag: true, + tagName: 'v%VERSION%', + tagMessage: 'Version %VERSION%', + push: true, + pushTo: 'upstream', + gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d', + prereleaseName: 'pre', + regExp: new RegExp('([\'|\"]?[version|VERSION][\'|\"]?[ ]*[:|=][ ]*[\'|\"]?)(\\d+\\.\\d+\\.\\d+(-\\.\\d+)?(-\\d+)?)[\\d||A-a|.|-]*([\'|\"]?)', 'i') + } + }, + bootcamp: { test: { files: { @@ -79,10 +97,14 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-bump'); grunt.loadNpmTasks('bootcamp'); grunt.registerTask('test', ['sass', 'bootcamp']); grunt.registerTask('dev', ['test', 'watch']); grunt.registerTask('build', ['test', 'concat']); + + var versionBump = grunt.option('versionBump') || 'minor'; + grunt.registerTask('release', ['build', 'bump-only:' + versionBump, 'bump-commit']); } diff --git a/dist/_bem-constructor.scss b/dist/_bem-constructor.scss index 3b90156..761e671 100644 --- a/dist/_bem-constructor.scss +++ b/dist/_bem-constructor.scss @@ -1,4 +1,4 @@ -/*! bem-constructor - v0.3.2 - 2015-03-26 */ +/*! bem-constructor - version : 0.3.2 - 2015-03-26 */ // ----------------------------------------------------------------------------- // Defaults // ----------------------------------------------------------------------------- diff --git a/package.json b/package.json index 576ff3e..c2b0d35 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "grunt-contrib-sass": "^0.8.1", "bootcamp": "^1.1.7", "grunt-contrib-watch": "^0.6.1", - "grunt-contrib-concat": "^0.5.1" + "grunt-contrib-concat": "^0.5.1", + "grunt-bump": "^0.3.0" } }