fix: Fix .dmg signing
This commit is contained in:
39
build/notarize.js
Normal file
39
build/notarize.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const { notarize } = require('@electron/notarize');
|
||||
|
||||
exports.default = async function notarizing(context) {
|
||||
const { electronPlatformName, appOutDir } = context;
|
||||
|
||||
// Only notarize macOS builds
|
||||
if (electronPlatformName !== 'darwin') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip notarization if credentials are not provided
|
||||
const appleId = process.env.APPLE_ID;
|
||||
const appleIdPassword = process.env.APPLE_ID_PASSWORD;
|
||||
const teamId = process.env.APPLE_TEAM_ID;
|
||||
|
||||
if (!appleId || !appleIdPassword || !teamId) {
|
||||
console.log('Skipping notarization: Apple ID credentials not provided');
|
||||
return;
|
||||
}
|
||||
|
||||
const appName = context.packager.appInfo.productFilename;
|
||||
|
||||
console.log(`Notarizing ${appName}...`);
|
||||
|
||||
try {
|
||||
await notarize({
|
||||
appBundleId: 'com.karmaa.termix',
|
||||
appPath: `${appOutDir}/${appName}.app`,
|
||||
appleId: appleId,
|
||||
appleIdPassword: appleIdPassword,
|
||||
teamId: teamId,
|
||||
});
|
||||
|
||||
console.log(`Successfully notarized ${appName}`);
|
||||
} catch (error) {
|
||||
console.error('Notarization failed:', error);
|
||||
// Don't fail the build if notarization fails
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user