Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add mac arm build #153

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ linux32: build
mac: build
yarn build:mac
yarn pkg:mac
macarm: build
yarn build:macarm
yarn pkg:macarm
dmg: mac
yarn build:dmg

Expand Down
29 changes: 29 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,32 @@ gulp.task("linux32zip", done => {
archive.directory(inputDir, false);
archive.finalize().then(done);
});

gulp.task("mac-arm64", done => {
console.log(`--package ${NAME}-darwin-arm64`);

plugins.run(`rm -rf ${TARGET}/${NAME}-darwin-arm64`).exec(() => {
let options = Object.assign({}, packagerOptions);
options.platform = "darwin";
options.arch = "arm64";
options.icon = `${BRAND}/qiniu.icns`;

packager(options).then((paths) => {
console.log("--done");
done();
}, (errs) => {
console.error(errs);
});
});
});

gulp.task("macarmzip", done => {
console.log(`--package ${KICK_NAME}-darwin-arm64-v${VERSION}.zip`);
var outputZip = fs.createWriteStream(`${TARGET}/${KICK_NAME}-darwin-arm64-v${VERSION}.zip`);
var archive = archiver('zip', { zlib: { level: 9 } });
archive.on('error', (err) => { throw err; });
archive.pipe(outputZip);
archive.directory(`${TARGET}/${NAME}-darwin-arm64/${NAME}.app`, `${NAME}.app`);
archive.finalize().then(done);
});

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"watch": "./node_modules/.bin/webpack --env development -c ./webpack/webpack.config.js -w",
"build": "./node_modules/.bin/webpack --env production --env sourcemap -c ./webpack/webpack.config.js",
"build:mac": "./node_modules/.bin/gulp mac",
"build:macarm": "./node_modules/.bin/gulp mac-arm64",
"pkg:mac": "./node_modules/.bin/gulp maczip",
"pkg:macarm": "./node_modules/.bin/gulp macarmzip",
"build:dmg": "./node_modules/.bin/gulp dmg",
"build:win32": "./node_modules/.bin/gulp win32",
"pkg:win32": "./node_modules/.bin/gulp win32zip",
Expand Down