2019-10-09 17:29:24 +02:00
|
|
|
const { notarize } = require('electron-notarize');
|
|
|
|
|
|
|
|
exports.default = async function(context) {
|
2019-10-09 17:40:31 +02:00
|
|
|
const { electronPlatformName, appOutDir } = context;
|
2019-10-09 17:29:24 +02:00
|
|
|
|
2019-10-11 13:01:50 +02:00
|
|
|
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) {
|
2020-02-25 12:44:33 +01:00
|
|
|
console.warn(
|
2020-02-25 13:05:36 +01:00
|
|
|
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" +
|
|
|
|
"! Skipping notarisation: User ID not found, set NOTARIZE_APPLE_ID. !\n" +
|
|
|
|
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
|
2020-02-25 12:44:33 +01:00
|
|
|
);
|
|
|
|
return;
|
2019-10-11 13:01:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
console.log("Notarising macOS app. This may be some time.");
|
|
|
|
return await notarize({
|
|
|
|
appBundleId: 'im.riot.app',
|
|
|
|
appPath: `${appOutDir}/${appName}.app`,
|
|
|
|
appleId: userId,
|
|
|
|
appleIdPassword: '@keychain:NOTARIZE_CREDS',
|
|
|
|
});
|
|
|
|
}
|
2019-10-09 17:29:24 +02:00
|
|
|
};
|