Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to notarytool #440

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions scripts/electron_afterSign.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,26 @@ exports.default = async function(context) {

if (electronPlatformName === 'darwin') {
const appName = context.packager.appInfo.productFilename;
// We get the password from keychain. The keychain stores
// user IDs too, but apparently altool can't get the user ID
// from the keychain, so we need to get it from the environment.
const userId = process.env.NOTARIZE_APPLE_ID;
if (userId === undefined) {

const keychainProfile = process.env.NOTARIZE_KEYCHAIN_PROFILE;
if (keychainProfile === undefined) {
if (!warned) {
console.log("*************************************");
console.log("* NOTARIZE_APPLE_ID is not set. *");
console.log("* This build will NOT be notarised. *");
console.log("*************************************");
console.log("*****************************************");
console.log("* NOTARIZE_KEYCHAIN_PROFILE is not set. *");
console.log("* This build will NOT be notarised. *");
console.log("*****************************************");
warned = true;
}
return;
}

console.log("Notarising macOS app. This may be some time.");
return await notarize({
tool: "notarytool",
appBundleId: appId,
appPath: `${appOutDir}/${appName}.app`,
appleId: userId,
appleIdPassword: '@keychain:NOTARIZE_CREDS',
keychainProfile,
keychain: process.env.NOTARIZE_KEYCHAIN,
});
}
};