Files
teleport/web/packages/teleterm/notarize.js
T
Rafał Cieślak b5a19bc3d8 Move electron-builder to a JS file (#1111)
* notarize.js: Use app bundle ID from packager settings

The previous version used to always take build.appId as the app bundle ID.
This commit makes it so that if we overwrite the bundle ID by suppling
target-specific settings, notarize.js will pick up those changes.

* Add macOS category for Teleport Connect

* Remove custom entitlements

electron-builder adds some default ones if not specified and they're just
enough for us. On top of that, by letting electron-builder handle that
we make sure that they'll stay up to date in case they ever need to be
updated due to changes in Electron or Chromium. See [1] for an example.

[1] https://www.electronjs.org/blog/electron-6-0#electron-helper-rendererapp-electron-helper-gpuapp-and-electron-helper-pluginapp

* Refactor getTshBinaryPath and getBinDir into single function

One depended on the other and they both used different logic which was
different for packaged vs non-packaged app. Now they're encapsulated within
a single function that returns both paths.

* Move electron-builder config to a js file

* Remove unused `publish` key from electron-builder config
2022-08-17 08:58:59 +00:00

26 lines
732 B
JavaScript

const { notarize } = require('electron-notarize');
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== 'darwin') {
return;
}
if (!process.env.APPLE_USERNAME || !process.env.APPLE_PASSWORD) {
console.warn(
'missing $APPLE_USERNAME and/or $APPLE_PASSWORD: notarization will be skipped'
);
return;
}
const appName = context.packager.appInfo.productFilename;
const appBundleId = context.packager.appInfo.macBundleIdentifier;
return await notarize({
appBundleId,
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_USERNAME,
appleIdPassword: process.env.APPLE_PASSWORD,
});
};