forked from Mechanical-Advantage/AdvantageScope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotarize.js
27 lines (23 loc) · 764 Bytes
/
notarize.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { notarize } = require("@electron/notarize");
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== "darwin") {
return;
}
const appleId = process.env.APPLE_ID;
const appleIdPwd = process.env.APPLE_ID_PWD;
const appleIdTeam = process.env.APPLE_ID_TEAM;
if (!appleId || !appleIdPwd || !appleIdTeam) {
console.log("No Apple ID provided, skipping notarization");
return;
}
const appName = context.packager.appInfo.productFilename;
console.log("Notarizing...");
return await notarize({
tool: "notarytool",
appPath: `${appOutDir}/${appName}.app`,
appleId: appleId,
appleIdPassword: appleIdPwd,
teamId: appleIdTeam
});
};