Generate a changelog using conventional-changelog
Issues with the output should be reported on the conventional-changelog
issue tracker.
Install
$ npm install --save-dev grunt-conventional-changelog
Usage
grunt.loadNpmTasks('grunt-conventional-changelog');
grunt.initConfig({
conventionalChangelog: {
options: {
changelogOpts: {
preset: 'angular'
},
context: {
},
gitRawCommitsOpts: {
},
parserOpts: {
},
writerOpts: {
}
},
release: {
src: 'CHANGELOG.md'
}
}
});
grunt.registerTask('default', ['conventionalChangelog']);
API
See the conventional-changelog docs.
There are some changes:
changelogOpts
warn
It is grunt.verbose.writeln
.
Edit your changelog manually
Sometimes after auto-generating the changelog you want to be able to review the generated changes or add some notes to the current release, you can polish your changelog manually without changing your workflow (you might use grunt-release
in the workflow but need grunt to wait until you have finished polishing your changelog).
Here are some examples of how to achieve this.
grunt.initConfig({
shell: {
changelog: {
options: {
stdinRawMode: true
},
command: 'subl -w CHANGELOG.md',
}
},
spawn: {
changelog: {
command: 'vim',
pattern: 'CHANGELOG.md',
commandArgs: ['{0}'],
opts: {
stdio: 'inherit'
}
}
},
});
...
grunt.registerTask('publish', ['changelog', 'shell:changelog', 'release']);
grunt.registerTask('publish', ['changelog', 'spawn:changelog', 'release']);
License
MIT