-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathgulpfile.js
44 lines (33 loc) · 1.09 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// try { require('gulplog').info = function() {}; } catch (err) {}
// try { require('fancy-log').apply = function() {}; } catch (err) {}
const path = require('path');
const fs = require('fs');
const gulp = require('gulp');
require('ts-node/register');
require('require-dir')(path.join(__dirname, 'scripts', 'gulp'));
gulp.task('build', ['!compile']);
const conventionalChangelog = require('gulp-conventional-changelog');
const git = require('gulp-git');
gulp.task('changelog', () =>
gulp.src('CHANGELOG.md', {
buffer: false,
})
.pipe(conventionalChangelog({
preset: 'angular',
}))
.pipe(gulp.dest('.'))
);
gulp.task('create-tag', (cb) => {
function getPackageJsonVersion() {
// We parse the json file instead of using require because require caches
// multiple calls so the version number won't be updated
return JSON.parse(fs.readFileSync('./package.json', 'utf8')).version;
}
const version = getPackageJsonVersion();
return git.tag(version, `chore(version): ${version}`, (error) => {
if (error) {
return cb(error);
}
return cb();
});
});