Skip to content

Commit 49cc72f

Browse files
committed
added release tasks
1 parent 445799d commit 49cc72f

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

gulpfile.js

+36
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var eslint = require('gulp-eslint');
99
var gulpBump = require('gulp-bump');
1010
var changelog = require('gulp-conventional-changelog');
1111
var tag = require('gulp-tag-version');
12+
var release = require('gulp-github-release');
1213
var sequence = require('run-sequence');
1314
var gutil = require('gulp-util');
1415
var replace = require('gulp-replace');
@@ -26,6 +27,26 @@ gulp.task('release', function(callback) {
2627
sequence('lint', 'test', 'build', 'bump:' + type, 'changelog', 'tag', callback);
2728
});
2829

30+
gulp.task('release:push', function(callback) {
31+
sequence('release:push:git', 'release:push:github', 'release:push:npm', callback);
32+
});
33+
34+
gulp.task('release:push:github', function(callback) {
35+
return gulp.src(['CHANGELOG.md', 'jquery.matchHeight-min.js', 'jquery.matchHeight.js'])
36+
.pipe(release({
37+
tag: pkg.version,
38+
name: 'jquery.matchHeight.js ' + pkg.version
39+
}));
40+
});
41+
42+
gulp.task('release:push:git', function(callback) {
43+
shell('git push', callback);
44+
});
45+
46+
gulp.task('release:push:npm', function(callback) {
47+
shell('npm publish', callback);
48+
});
49+
2950
gulp.task('build', function() {
3051
var build = extend(pkg);
3152
build.version = process.argv[4] || pkg.version;
@@ -221,3 +242,18 @@ var emulateIEMiddleware = {
221242
'ie9': emulateIEMiddlewareFactory(9),
222243
'ie10': emulateIEMiddlewareFactory(10)
223244
};
245+
246+
var shell = function(command, callback) {
247+
var args = process.argv.slice(3).join(' '),
248+
proc = exec(command + ' ' + args, function(err) {
249+
callback(err);
250+
});
251+
252+
proc.stdout.on('data', function(data) {
253+
process.stdout.write(data);
254+
});
255+
256+
proc.stderr.on('data', function(data) {
257+
process.stderr.write(data);
258+
});
259+
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"gulp-bump": "^1.0.0",
3333
"gulp-conventional-changelog": "^0.7.0",
3434
"gulp-eslint": "^1.0.0",
35+
"gulp-github-release": "^1.1.0",
3536
"gulp-header": "^1.7.1",
3637
"gulp-rename": "^1.2.2",
3738
"gulp-replace": "^0.5.4",

0 commit comments

Comments
 (0)