mattermost-desktop/scripts/notarize.js
Devin Binnie 9b36c25e4e
[MM-52696] Upgrade and clean up Desktop App dev dependencies (#2970)
* Upgrade to ESLint v8

* Upgrade TypeScript, api-types, react-intl

* Remove unnecessary dependencies

* Update to React 17.0.2

* npm audit fixes, remove storybook

* Lock some packages

* Remove nan patch

* Remove some deprecated dependencies

* Fix lint/type/tests

* Merge'd

* Fix bad use of spawn

* Fix notarize

* Fix afterpack, switch to tsc es2020

* Fix api types

* Use @mattermost/eslint-plugin
2024-03-07 15:55:33 -05:00

33 lines
1.1 KiB
JavaScript

// 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;
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;
}
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,
teamId: 'UQ8HT4Q2XM',
tool: 'notarytool',
});
};