forked from jaysalvat/image2css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
34 lines (30 loc) · 1017 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
var args = require('yargs').argv,
gulp = require('gulp'),
exec = require('gulp-exec'),
bump = require('gulp-bump');
var semver = args.semver || 'patch';
gulp.task('bump', function () {
return gulp.src(['./package.json', './composer.json'])
.pipe(bump())
.pipe(gulp.dest('./'));
});
gulp.task('release', ['bump'], function () {
var options = {
err: true,
stderr: true,
stdout: true
};
var version = 'v' + require('./package.json').version;
var message = 'Release ' + version;
return gulp.src('./', { read: false })
.pipe(exec('git add . -A'))
.pipe(exec.reporter(options))
.pipe(exec('git commit -m "' + message + '"'))
.pipe(exec.reporter(options))
.pipe(exec('git tag ' + version))
.pipe(exec.reporter(options))
.pipe(exec('git push origin master'))
.pipe(exec.reporter(options))
.pipe(exec('git push origin --tags'))
.pipe(exec.reporter(options));
});