Skip to content

Commit

Permalink
Switch to notarytool (#440)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7a8e5b6)
  • Loading branch information
t3chguy authored and github-actions[bot] committed Nov 7, 2022
1 parent b6659ad commit b217c01
Showing 1 changed file with 10 additions and 11 deletions.
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,
});
}
};

0 comments on commit b217c01

Please sign in to comment.