47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
const exec = require('child_process').exec;
|
|
const sign = require("electron-osx-sign").signAsync;
|
|
const notarize = require("electron-notarize").notarize;
|
|
|
|
const app = "Electron.app";
|
|
|
|
const runShellCommand = (cmd) => (new Promise((resolve, reject) => {
|
|
exec(cmd, (error, stdout, stderr) => {
|
|
error ? reject(stderr) : resolve(stdout);
|
|
});
|
|
}));
|
|
|
|
const signConfig = {
|
|
"app": app,
|
|
"hardened-runtime": true,
|
|
"gatekeeper-assess": false,
|
|
"signature-flags": "library",
|
|
"entitlements": "entitlements.plist",
|
|
"entitlements-inherit": "entitlements.plist",
|
|
};
|
|
|
|
const notarizeConfig = {
|
|
appPath: app,
|
|
appleId: "gundersena@crimata.com",
|
|
appBundleId: "com.github.Electron",
|
|
appleIdPassword: process.env["AC_PASSWORD"]
|
|
};
|
|
|
|
(async function () {
|
|
|
|
try
|
|
{
|
|
console.log("Cleaning App...");
|
|
await runShellCommand(`xattr -cr ${app}`);
|
|
|
|
console.log("Signing...");
|
|
await sign(signConfig);
|
|
|
|
console.log("Notarizing...");
|
|
await notarize(notarizeConfig);
|
|
}
|
|
catch (e)
|
|
{
|
|
console.log(e);
|
|
}
|
|
|
|
})();
|