Use subtree to push _release

master
Surma 2015-07-21 14:05:50 +01:00 committed by Addy Osmani
parent db798480f2
commit 2be4176174
2 changed files with 20 additions and 10 deletions

View File

@ -25,6 +25,7 @@ var fs = require('fs');
var merge = require('merge-stream'); var merge = require('merge-stream');
var $ = require('gulp-load-plugins')(); var $ = require('gulp-load-plugins')();
var del = require('del'); var del = require('del');
var vinylPaths = require('vinyl-paths');
var runSequence = require('run-sequence'); var runSequence = require('run-sequence');
var browserSync = require('browser-sync'); var browserSync = require('browser-sync');
var codeFiles = ''; var codeFiles = '';
@ -496,14 +497,6 @@ gulp.task('zip:mdl', function() {
.pipe(gulp.dest('dist')); .pipe(gulp.dest('dist'));
}); });
gulp.task('zip:mdl-source', function() {
return gulp.src(['dist/material?(.min)@(.js|.css)?(.map)', 'LICENSE',
'bower.json', 'package.json', './sr?/**/*', 'gulpfile.js'])
.pipe(gulp.dest('_release'))
.pipe($.zip('mdl-source.zip'))
.pipe(gulp.dest('dist'));
});
// Generate release archive containing the library, templates and assets // Generate release archive containing the library, templates and assets
// for templates. Note that it is intentional for some templates to include // for templates. Note that it is intentional for some templates to include
// a customised version of the material.min.css file for their own needs. // a customised version of the material.min.css file for their own needs.
@ -531,7 +524,7 @@ gulp.task('zip:templates', function() {
.pipe(gulp.dest('dist')); .pipe(gulp.dest('dist'));
}); });
gulp.task('zip', ['zip:templates', 'zip:mdl', 'zip:mdl-source']); gulp.task('zip', ['zip:templates', 'zip:mdl']);
gulp.task('genCodeFiles', function() { gulp.task('genCodeFiles', function() {
return gulp.src(['dist/material.*@(js|css)?(.map)', 'dist/mdl.zip', 'dist/mdl-templates.zip'], return gulp.src(['dist/material.*@(js|css)?(.map)', 'dist/mdl.zip', 'dist/mdl-templates.zip'],
@ -668,6 +661,21 @@ gulp.task('templates:mdl', function() {
.pipe(gulp.dest('dist/templates')); .pipe(gulp.dest('dist/templates'));
}); });
gulp.task('_release', function() {
return gulp.src(['dist/material?(.min)@(.js|.css)?(.map)', 'LICENSE',
'bower.json', 'package.json', './sr?/**/*', 'gulpfile.js'])
.pipe(gulp.dest('_release'));
});
gulp.task('publish:bower', ['_release'], function() {
return gulp.src('_release')
.pipe($.subtree({
remote: 'origin',
branch: 'release'
}))
.pipe(vinylPaths(del));
});
gulp.task('templates:styles', function() { gulp.task('templates:styles', function() {
return gulp.src([ return gulp.src([
'templates/**/*.css' 'templates/**/*.css'

View File

@ -42,6 +42,7 @@
"gulp-shell": "^0.4.2", "gulp-shell": "^0.4.2",
"gulp-size": "^1.0.0", "gulp-size": "^1.0.0",
"gulp-sourcemaps": "^1.3.0", "gulp-sourcemaps": "^1.3.0",
"gulp-subtree": "^0.1.0",
"gulp-tap": "^0.1.3", "gulp-tap": "^0.1.3",
"gulp-uglify": "^1.0.1", "gulp-uglify": "^1.0.1",
"gulp-useref": "^1.0.1", "gulp-useref": "^1.0.1",
@ -57,7 +58,8 @@
"require-dir": "^0.3.0", "require-dir": "^0.3.0",
"run-sequence": "^1.0.2", "run-sequence": "^1.0.2",
"swig": "^1.4.2", "swig": "^1.4.2",
"through2": "^0.6.3" "through2": "^0.6.3",
"vinyl-paths": "^1.0.0"
}, },
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"