-
Notifications
You must be signed in to change notification settings - Fork 4
/
afterSign.mjs
35 lines (28 loc) · 1.05 KB
/
afterSign.mjs
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
import fs from 'fs';
import path from 'path';
import { notarize } from '@electron/notarize';
export default async function notarizeApp(params) {
// Only notarize the app on macOS.
if (process.platform !== 'darwin') {
return;
}
console.log('afterSign hook triggered', params);
const appId = 'org.kryptokrona.aesir';
const appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}
console.log(`Notarizing ${appId} found at ${appPath}`);
try {
await notarize({
appBundleId: appId,
appPath,
appleId: process.env.appleId, // Apple Developer ID
appleIdPassword: process.env.appleIdPassword, // App-specific password
teamId: process.env.teamId, // Team ID
});
} catch (error) {
console.error('Notarization failed:', error);
}
console.log(`Done notarizing ${appId}`);
}