-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathnotarize.js
36 lines (30 loc) · 1006 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
28
29
30
31
32
33
34
35
36
const { notarize } = require('@electron/notarize');
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== 'darwin') {
return;
}
if (!process.env.APPLE_USERNAME || !process.env.APPLE_PASSWORD) {
console.warn(
'missing $APPLE_USERNAME and/or $APPLE_PASSWORD: notarization will be skipped'
);
return;
}
if (!process.env.TEAMID) {
console.warn(
'missing $TEAMID: notarization will be skipped. Run `make release-connect` instead'
);
return;
}
const appName = context.packager.appInfo.productFilename;
const appBundleId = context.packager.appInfo.macBundleIdentifier;
console.log('notarize.js: Notarizing in progress.');
return await notarize({
appBundleId,
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_USERNAME,
appleIdPassword: process.env.APPLE_PASSWORD,
tool: 'notarytool',
teamId: process.env.TEAMID,
});
};