-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
39 lines (27 loc) · 845 Bytes
/
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
var gulp = require('gulp');
var git = require('gulp-git');
var bump = require('gulp-bump');
var exec = require('gulp-exec');
gulp.task('bump', function () {
return gulp.src(['./package.json'])
.pipe(bump())
.pipe(gulp.dest('./'));
});
gulp.task('tag', ['bump'], function (done) {
var pkg = require('./package.json');
var message = 'Release ' + pkg.version;
gulp.src('./')
.pipe(git.commit(message));
git.tag(pkg.version, message);
git.push('origin', 'master', {args: '--tags'}, done);
});
gulp.task('npm', ['tag'], function () {
var version = require('./package.json').version;
var options = {
silent: false,
version: version
};
gulp.src('./')
.pipe(exec('npm publish --tag <%= options.version %>', options));
});
gulp.task('release', ['npm']);