diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3ae47ec46..8bcc068df 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,8 +30,7 @@ Open your console with: ### Release -- To patch, run `grunt patch` (`0.0.x` version bump). -- To upgrade, run `grunt upgrade` (`0.x.0` version bump). +- Update the version with `grunt patch`, `grunt minor` or `grunt major`. - Release with `grunt release`. Note: this is only used to release new 4chan X versions, and is **not** needed or wanted in pull requests. diff --git a/Gruntfile.js b/Gruntfile.js index cdde902a2..bc9263a64 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -91,7 +91,16 @@ module.exports = function(grunt) { grunt.registerTask('default', ['concat:coffee', 'coffee:script', 'concat:script', 'concat:metadata', 'clean']); grunt.registerTask('release', ['default', 'exec:commit', 'exec:push']); - grunt.registerTask('patch', ['bump']); - grunt.registerTask('upgrade', ['bump:minor']); + grunt.registerTask('patch', ['bump', 'updcl:3']); + grunt.registerTask('minor', ['bump:minor', 'updcl:2']); + grunt.registerTask('major', ['bump:major', 'updcl:1']); + grunt.registerTask('updcl', 'Update the changelog', function(i) { + // Update the `pkg` object with the new version. + pkg = grunt.file.readJSON('package.json'); + // i is the number of #s for markdown. + var version = new Array(+i + 1).join('#') + ' ' + pkg.version; + grunt.file.write('CHANGELOG.md', version + '\n' + grunt.file.read('CHANGELOG.md')); + grunt.log.ok('Changelog updated for v' + pkg.version + '.'); + }); };