Skip to content

Commit

Permalink
Add grunt-bump task
Browse files Browse the repository at this point in the history
  • Loading branch information
danielguillan committed Mar 26, 2015
1 parent d564da7 commit cdd023b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
24 changes: 23 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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']);
}

2 changes: 1 addition & 1 deletion dist/_bem-constructor.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! bem-constructor - v0.3.2 - 2015-03-26 */
/*! bem-constructor - version : 0.3.2 - 2015-03-26 */
// -----------------------------------------------------------------------------
// Defaults
// -----------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit cdd023b

Please sign in to comment.