Last active
August 29, 2015 14:24
-
-
Save duvillierA/f9acfb3a8d397fd5a493 to your computer and use it in GitHub Desktop.
Release to git with a gulp task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
gulp = require('gulp'), | |
semver = require('semver'), | |
$ = require('gulp-load-plugins')(); | |
var inc = function(importance) { | |
return gulp.src(['./package.json']) | |
.pipe($.bump({type: importance})) | |
.pipe(gulp.dest('./')) | |
.pipe($.git.commit('Release v' + semver.inc( | |
require(__dirname + '/package.json').version, | |
importance))) | |
.pipe($.tagVersion()) | |
.pipe($.git.push('origin', 'master', { args: '--tags' })); | |
}; | |
/* Version bumping ------------------------------------------------------- */ | |
gulp.task('patch', function() { return inc('patch'); }); | |
gulp.task('feature', function() { return inc('minor'); }); | |
gulp.task('release', function() { return inc('major'); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment