Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 3dfb12e

Browse files
committed
Add bumping and tagging to gulp file.
1 parent 45547d6 commit 3dfb12e

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

gulpfile.js

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
'use strict'
22

33
var gulp = require('gulp')
4+
, bump = require('gulp-bump')
5+
, filter = require('gulp-filter')
6+
, git = require('gulp-git')
47
, purescript = require('gulp-purescript')
58
, run = require('gulp-run')
69
, runSequence = require('run-sequence')
10+
, tagVersion = require('gulp-tag-version')
711
;
812

913
var paths =
@@ -36,17 +40,41 @@ var compile = function(compiler, src, opts) {
3640

3741
function docs (target) {
3842
return function() {
39-
var docgen = purescript.docgen();
40-
docgen.on('error', function(e) {
43+
var pscDocs = purescript.pscDocs();
44+
pscDocs.on('error', function(e) {
4145
console.error(e.message);
42-
docgen.end();
46+
pscDocs.end();
4347
});
4448
return gulp.src(paths.docs[target].src)
45-
.pipe(docgen)
49+
.pipe(pscDocs)
4650
.pipe(gulp.dest(paths.docs[target].dest));
4751
}
4852
}
4953

54+
gulp.task('tag', function() {
55+
return gulp.src(['bower.json', 'package.json'])
56+
.pipe(git.commit('Update versions.'))
57+
.pipe(filter('bower.json'))
58+
.pipe(tagVersion());
59+
});
60+
61+
// For whatever reason, these cannot be factored out...
62+
gulp.task('bump-major', function() {
63+
return gulp.src(['bower.json', 'package.json'])
64+
.pipe(bump({type: 'major'}))
65+
.pipe(gulp.dest('./'));
66+
});
67+
gulp.task('bump-minor', function() {
68+
return gulp.src(['bower.json', 'package.json'])
69+
.pipe(bump({type: 'minor'}))
70+
.pipe(gulp.dest('./'));
71+
});
72+
gulp.task('bump-patch', function() {
73+
return gulp.src(['bower.json', 'package.json'])
74+
.pipe(bump({type: 'patch'}))
75+
.pipe(gulp.dest('./'));
76+
});
77+
5078
gulp.task('make', function() {
5179
return compile(purescript.pscMake, [paths.src], {});
5280
});

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
},
1919
"devDependencies": {
2020
"gulp": "~3.8.6",
21+
"gulp-bump": "^0.1.11",
22+
"gulp-filter": "^1.0.2",
23+
"gulp-git": "^0.5.5",
2124
"gulp-purescript": "^0.0.9",
2225
"gulp-run": "~1.6.4",
26+
"gulp-tag-version": "^1.2.1",
2327
"run-sequence": "^0.3.6"
2428
}
2529
}

0 commit comments

Comments
 (0)