Generate a changelog using conventional-changelog
Issues with the output should be reported on the conventional-changelog
issue tracker.
Checkout the gulp official recipe to automate releases with gulp and gulp-conventional-changelog.
$ npm install --save-dev gulp-conventional-changelog
var gulp = require('gulp');
var conventionalChangelog = require('gulp-conventional-changelog');
gulp.task('changelog', function () {
return gulp.src('CHANGELOG.md')
.pipe(conventionalChangelog({
// conventional-changelog options go here
preset: 'angular'
}, {
// context goes here
}, {
// git-raw-commits options go here
}, {
// conventional-commits-parser options go here
}, {
// conventional-changelog-writer options go here
}))
.pipe(gulp.dest('./'));
});
gulp.task('changelog', function () {
return gulp.src('CHANGELOG.md', {
buffer: false
})
.pipe(conventionalChangelog({
preset: 'angular'
}))
.pipe(gulp.dest('./'));
});
gulp.task('changelog', function () {
return gulp.src('CHANGELOG.md')
.pipe(conventionalChangelog({
preset: 'angular'
}))
.pipe(gulp.dest('./'));
});
Note: If your options.releaseCount
is 0
(regenerate all changelog from previous releases) you can just use conventional-changelog directly or not to read the file at all.
var gulp = require('gulp');
var conventionalChangelog = require('conventional-changelog');
var fs = require('fs');
gulp.task('default', function () {
return conventionalChangelog({
preset: 'angular',
releaseCount: 0
})
.pipe(fs.createWriteStream('CHANGELOG.md'));
});
Or
var gulp = require('gulp');
var conventionalChangelog = require('gulp-conventional-changelog');
gulp.task('default', function () {
return gulp.src('CHANGELOG.md', {
read: false
})
.pipe(conventionalChangelog({
preset: 'angular',
releaseCount: 0
}))
.pipe(gulp.dest('./'));
});
See the conventional-changelog docs.
There are some changes:
If the cli contains flag --verbose
it is gutil.log
.
MIT © Steve Mao