build(zone.js): update gulp task to gen changelog automatically (#31915)

PR Close #31915
This commit is contained in:
JiaLiPassion
2019-08-01 13:41:37 -06:00
committed by Alex Rickabaugh
parent fa4e17082c
commit 2a6e6c02ed
3 changed files with 21 additions and 12 deletions

View File

@ -10,13 +10,20 @@ module.exports = (gulp) => () => {
const tag = process.env.TAG;
const ptag = process.env.PREVIOUS_ZONE_TAG;
const conventionalChangelog = require('gulp-conventional-changelog');
// the tag of zone.js will start with `zone.js-`, such as `zone.js-0.10.0`
// we will remove the first 8 (zone.js-) chars to get the real version.
const version = tag.replace(/^zone\.js-/, '');
return gulp.src('packages/zone.js/CHANGELOG.md')
.pipe(conventionalChangelog({preset: 'angular'}, {}, {
// Ignore commits that have a different scope than `zone.js`.
extendedRegexp: true,
grep: '^[^(]+\\(zone\\.js\\)',
from: ptag,
to: tag,
}))
.pipe(conventionalChangelog(
{
preset: 'angular',
},
{linkCompare: true, previousTag: ptag, currentTag: tag, version: version}, {
// Ignore commits that have a different scope than `zone.js`.
extendedRegexp: true,
grep: '^[^(]+\\(zone\\.js\\)',
from: ptag,
to: tag,
}))
.pipe(gulp.dest('./packages/zone.js/'));
};