-
Notifications
You must be signed in to change notification settings - Fork 271
/
Copy pathnotarize.js
31 lines (25 loc) · 913 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
const { notarize } = require('@electron/notarize');
const packageJson = require('../package.json');
const appBundleId = packageJson.build.appId;
const notarizeApp = async (context) => {
const { electronPlatformName, appOutDir } = context;
const appName = context.packager.appInfo.productFilename;
const isMacOS = electronPlatformName === 'darwin';
const shouldNotarize = process.env.NOTARIZE === 'true';
if (!shouldNotarize || !isMacOS) {
console.log(
' • notarizing either should not notarize or not building for macOS',
);
return;
}
console.log(' • notarizing started');
return await notarize({
appBundleId,
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID_USERNAME,
appleIdPassword: process.env.APPLEID_PASSWORD,
teamId: process.env.APPLEID_TEAM_ID,
tool: 'notarytool',
});
};
exports.default = notarizeApp;