add auto-zipping to gulpfile

This commit is contained in:
printempw 2016-07-23 16:24:44 +08:00
parent 4dcb5772a6
commit b3d7dd98b8
2 changed files with 35 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* @Author: prpr
* @Date: 2016-07-21 13:38:26
* @Last Modified by: printempw
* @Last Modified time: 2016-07-22 10:47:37
* @Last Modified time: 2016-07-23 16:22:46
*/
var gulp = require('gulp'),
@ -13,7 +13,10 @@ var gulp = require('gulp'),
cleanCss = require('gulp-clean-css'),
rename = require('gulp-rename'),
del = require('del'),
replace = require('gulp-replace');
replace = require('gulp-replace')
zip = require('gulp-zip');
var version = "3.0-beta";
/**
* Copy files from bower_components to dist for later operations
@ -150,4 +153,32 @@ gulp.task('clean', ['concat', 'minify'], function (cb) {
gulp.task('build', ['concat', 'minify', 'clean']);
// release
gulp.task('zip', function() {
del('resources/cache/*');
return gulp.src([
'**/*.*',
'!node_modules/**/*.*',
'!textures/**/*.*',
'!.env',
'!.bowerrc',
'!.gitignore',
'!.git/**/*.*',
'!.git/',
'!koala-config.json',
'!gulpfile.js',
'!package.json',
'!composer.json',
'!composer.lock',
'!bower.json',
'!assets/bower_components/**/*.*',
'!assets/src/**/*.*',
'!.sass-cache/**/*.*',
'!.sass-cache/'
], { dot: true })
.pipe(zip('blessing-skin-server-'+version+'.zip'))
.pipe(gulp.dest('./'));
});
gulp.task('default', ['copy']);

View File

@ -16,6 +16,7 @@
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-ruby-sass": "^2.0.6",
"gulp-uglify": "^1.5.4"
"gulp-uglify": "^1.5.4",
"gulp-zip": "^3.2.0"
}
}