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 14, 2016
1 parent a9122ed commit 5479fbc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
30 changes: 29 additions & 1 deletion Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var eslint = require('gulp-eslint');
var bump = 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 @@ -24,6 +25,7 @@ var fs = require('fs');
var watchify = require('watchify');
var extend = require('util')._extend;
var exec = require('child_process').exec;
var buildDirectory = 'build';
var server;

gulp.task('default', ['build:dev', 'build:examples']);
Expand All @@ -36,6 +38,32 @@ gulp.task('release', function(callback) {
sequence('build:dev', 'build:examples', 'test', 'build:release', 'bump', 'doc', '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',
'LICENSE',
buildDirectory + '/matter-' + pkg.version + '.min.js',
buildDirectory + '/matter-' + pkg.version + '.js'
]).pipe(release({
owner: 'liabru',
repo: pkg.name,
tag: pkg.version,
name: 'Matter.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:dev', function() {
return build(extend(extend({}, pkg), { version: 'dev' }));
});
Expand Down Expand Up @@ -139,7 +167,7 @@ gulp.task('doc', function(callback) {
outdir: 'doc/build',
linkNatives: true,
project: {
name: pkg.name + '.js Physics Engine API Documentation for ' + pkg.version,
name: pkg.name + ' ' + pkg.version + ' Physics Engine API Docs',
description: pkg.description,
version: pkg.version,
url: pkg.homepage
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"gulp-concat": "^2.6.0",
"gulp-conventional-changelog": "^0.7.0",
"gulp-eslint": "^1.0.0",
"gulp-github-release": "^1.1.0",
"gulp-header": "^1.7.1",
"gulp-preprocess": "^2.0.0",
"gulp-rename": "^1.2.2",
Expand Down

0 comments on commit 5479fbc

Please sign in to comment.