Skip to content

Commit

Permalink
⚡ Produce zip packages from gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Aug 29, 2019
1 parent b130b57 commit 4beafeb
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 3 deletions.
14 changes: 11 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const path = require('path'),
stylint = require('gulp-stylint'),
globby = require('globby'),
filemode = require('filemode'),
zip = require('gulp-zip'),

streamQueue = require('streamqueue'),
notifier = require('node-notifier'),
Expand Down Expand Up @@ -280,9 +281,9 @@ const fixSymlinks = async () => {
const glob = baseDir + '/Versions/*/nwjs Framework.framework/*';
const execute = require('./node_requires/execute');
const frameworkDir = path.dirname((await globby([glob]))[0]);

console.log('fixing symlinks at', frameworkDir);

execute(async ({exec}) => {
await exec(`
cd "$(find "${frameworkDir}" -name "nwjs Framework.framework")"
Expand All @@ -308,6 +309,12 @@ const examples = () => {
);
return Promise.all(promises);
};
const zipsForAllPlatforms = platforms.map(platform => () =>
gulp.src(`./build/ctjs - v${pack.version}/${platform}/**`)
.pipe(zip(`ct.js v${pack.version} for ${platform}.zip`))
.pipe(gulp.dest(`./build/ctjs - v${pack.version}/`))
);
const zipPackages = gulp.parallel(zipsForAllPlatforms);

const packages = gulp.series([
lint,
Expand All @@ -317,7 +324,8 @@ const packages = gulp.series([
nwPackages,
fixSymlinks,
fixPermissions,
examples
examples,
zipPackages
]);

const deployOnly = () => {
Expand Down
98 changes: 98 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"gulp-sourcemaps": "^2.6.4",
"gulp-stylint": "^4.0.2",
"gulp-stylus": "^2.7.0",
"gulp-zip": "^5.0.0",
"minimist": "^1.2.0",
"node-notifier": "^5.2.1",
"nw-builder": "^3.5.7",
Expand Down

0 comments on commit 4beafeb

Please sign in to comment.