mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
096a828e44
This allows Windows builds to complete when the singing token is not present.
31 lines
1.2 KiB
JavaScript
31 lines
1.2 KiB
JavaScript
const { notarize } = require('electron-notarize');
|
|
|
|
exports.default = async function(context) {
|
|
const { electronPlatformName, appOutDir } = 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) {
|
|
console.warn(
|
|
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" +
|
|
"! Skipping macOS notarisation. !\n" +
|
|
"! User ID not found, set NOTARIZE_APPLE_ID. !\n" +
|
|
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
|
|
);
|
|
return;
|
|
}
|
|
|
|
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',
|
|
});
|
|
}
|
|
};
|