From 49cc72f82ff98f8e403a123fada60e1360eeb334 Mon Sep 17 00:00:00 2001 From: liabru Date: Mon, 4 Jan 2016 20:22:48 +0000 Subject: [PATCH] added release tasks --- gulpfile.js | 36 ++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 37 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index f8d64cf..0e99488 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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'); @@ -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; @@ -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); + }); +}; \ No newline at end of file diff --git a/package.json b/package.json index 278968a..ac4b6e2 100644 --- a/package.json +++ b/package.json @@ -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",