mcopy/app/scripts/build_and_sign_mac.js

41 lines
1015 B
JavaScript

/** ./node_modules/.bin/electron-packager .
--overwrite
--platform=darwin
--arch=x64
--icon=assets/icons/icon.icns
--prune=true
--out=../dist **/
const packager = require('electron-packager');
const { readFileSync } = require('fs');
const appleId = (readFileSync('.appleId', 'utf8') ).trim();
const appleIdPassword = (readFileSync('.applePwd', 'utf8') ).trim();
// security find-identity to find exact string
const appleIdentity = (readFileSync('.appleIdentity', 'utf8') ).trim();
const pkg = require('../package.json');
const config = {
dir : '.',
platform : 'darwin',
arch : 'x64',
prune : true,
appBundleId : pkg.build.appId,
icon : './assets/icons/icon.icns',
overwrite : true,
out : '../dist',
osxSign : {
identity : appleIdentity,
'hardened-runtime' : true,
entitlements : './entitlements.plist',
'entitlements-inherit': './entitlements.plist',
'signature-flags' : 'library'
},
osxNotarize : {
appleId,
appleIdPassword
}
};
packager(config);