-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
40 lines (32 loc) · 977 Bytes
/
gulpfile.js
File metadata and controls
40 lines (32 loc) · 977 Bytes
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
'use strict';
const gulp = require('gulp');
const bump = require('gulp-bump');
const git = require('gulp-git');
const tagVersion = require('gulp-tag-version');
const wait = require('gulp-wait');
const path = require('path');
gulp.task('bump', () => {
return gulp.src(path.join(process.cwd(), 'package.json'))
.pipe(bump())
.pipe(gulp.dest('./'));
});
gulp.task('git:add', () => {
return gulp.src(process.cwd())
.pipe(git.add({ args: '--all -v' }));
});
gulp.task('git:commit', () => {
return gulp.src(process.cwd())
.pipe(git.commit(process.argv[4] || 'Bump version'));
});
gulp.task('git:tag', () => {
return gulp.src(path.join(process.cwd(), 'package.json'))
.pipe(tagVersion())
.pipe(wait(500));
});
gulp.task('git:push', (callback) => {
git.push('origin', 'master', { args: '-v --tags' }, () => {
callback();
});
});
gulp.task('git', gulp.series('git:add', 'git:commit', 'git:tag', 'git:push'));
gulp.task('release', gulp.series('bump', 'git'));