-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnotarize.js
37 lines (29 loc) · 872 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
37
const fs = require('fs');
const path = require('path');
const electronNotarize = require('electron-notarize');
const APP_ID = 'debug.video.app';
module.exports = async (params) => {
if (process.platform !== 'darwin') {
return;
}
if (process.env.SKIP_NOTARIZE) {
console.log('Skipping notarization due to SKIP_NOTARIZE');
return;
}
const appPath = path.join(
params.appOutDir,
`${params.packager.appInfo.productFilename}.app`
);
if (!fs.existsSync(appPath)) {
console.log(`${appPath} doesn\'t exist, skipping notarization`);
return;
}
console.log(`Notarizing ${APP_ID} found at ${appPath}`);
await electronNotarize.notarize({
appBundleId: APP_ID,
appPath: appPath,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_APP_PASSWORD,
});
console.log(`Done notarizing ${APP_ID}`);
};