Skip to content

Commit

Permalink
[Backport staging] Switch to notarytool (#443)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
RiotRobot and t3chguy authored Nov 8, 2022
1 parent a104be4 commit 8473f3e
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 8473f3e

Please sign in to comment.