-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgulpfile.js
51 lines (41 loc) · 1.02 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
45
46
47
48
49
50
51
var destFolderPath = '../cht8687.github.io/react-expandable-listview/example';
var gulp = require('gulp');
var runSequence = require('run-sequence');
var shell = require('gulp-shell');
var gulptil = require('gulp-util');
// Variables
var version = '0.5.0';
var gitCommit = `git commit -m ${version}`;
var gitTag = `git tag v${version}`;
gulp.task('npm-pub',shell.task([
`npm publish`
]
));
gulp.task('moveToDest',['npm-pub'], function(){
gulptil.log('Moving example files to github.io...');
return gulp.src(['example/*.js','example/*.html'])
.pipe(gulp.dest(destFolderPath))
});
gulp.task('pub',['moveToDest'], function(){
return runSequence('push-to-git');
});
gulp.task('git-add', shell.task([
`git add -A`
]
));
gulp.task('git-commit', shell.task([
gitCommit
]
));
gulp.task('git-push', shell.task([
`git push`,
]
))
gulp.task('git-tag', shell.task([
gitTag,
`git push --tags`
]
))
gulp.task('push-to-git', function(){
return runSequence('git-add','git-commit','git-push','git-tag');
});