2019-10-21 23:48:00 -07:00
|
|
|
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
|
|
|
// inspired by https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/
|
|
|
|
require('dotenv').config();
|
|
|
|
const {notarize} = require('electron-notarize');
|
|
|
|
|
|
|
|
const config = require('../electron-builder.json');
|
|
|
|
|
|
|
|
exports.default = async function notarizing(context) {
|
|
|
|
const {electronPlatformName, appOutDir} = context;
|
|
|
|
if (electronPlatformName !== 'darwin' || process.platform !== 'darwin') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const appName = context.packager.appInfo.productFilename;
|
2019-11-19 02:31:32 -08:00
|
|
|
if (typeof process.env.APPLEID === 'undefined') {
|
|
|
|
console.log('skipping notarization, remember to setup environment variables for APPLEID and APPLEIDPASS if you want to notarize');
|
|
|
|
return;
|
|
|
|
}
|
2019-10-21 23:48:00 -07:00
|
|
|
await notarize({
|
|
|
|
|
|
|
|
// should we change it to appBundleId: 'com.mattermost.desktop',
|
|
|
|
appBundleId: config.appId,
|
|
|
|
appPath: `${appOutDir}/${appName}.app`,
|
|
|
|
appleId: process.env.APPLEID,
|
|
|
|
appleIdPassword: process.env.APPLEIDPASS,
|
|
|
|
});
|
|
|
|
};
|