Skip to content

Commit

Permalink
added release tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 4, 2016
1 parent 445799d commit 49cc72f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var eslint = require('gulp-eslint');
var gulpBump = require('gulp-bump');
var changelog = require('gulp-conventional-changelog');
var tag = require('gulp-tag-version');
var release = require('gulp-github-release');
var sequence = require('run-sequence');
var gutil = require('gulp-util');
var replace = require('gulp-replace');
Expand All @@ -26,6 +27,26 @@ gulp.task('release', function(callback) {
sequence('lint', 'test', 'build', 'bump:' + type, 'changelog', 'tag', callback);
});

gulp.task('release:push', function(callback) {
sequence('release:push:git', 'release:push:github', 'release:push:npm', callback);
});

gulp.task('release:push:github', function(callback) {
return gulp.src(['CHANGELOG.md', 'jquery.matchHeight-min.js', 'jquery.matchHeight.js'])
.pipe(release({
tag: pkg.version,
name: 'jquery.matchHeight.js ' + pkg.version
}));
});

gulp.task('release:push:git', function(callback) {
shell('git push', callback);
});

gulp.task('release:push:npm', function(callback) {
shell('npm publish', callback);
});

gulp.task('build', function() {
var build = extend(pkg);
build.version = process.argv[4] || pkg.version;
Expand Down Expand Up @@ -221,3 +242,18 @@ var emulateIEMiddleware = {
'ie9': emulateIEMiddlewareFactory(9),
'ie10': emulateIEMiddlewareFactory(10)
};

var shell = function(command, callback) {
var args = process.argv.slice(3).join(' '),
proc = exec(command + ' ' + args, function(err) {
callback(err);
});

proc.stdout.on('data', function(data) {
process.stdout.write(data);
});

proc.stderr.on('data', function(data) {
process.stderr.write(data);
});
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"gulp-bump": "^1.0.0",
"gulp-conventional-changelog": "^0.7.0",
"gulp-eslint": "^1.0.0",
"gulp-github-release": "^1.1.0",
"gulp-header": "^1.7.1",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
Expand Down

0 comments on commit 49cc72f

Please sign in to comment.