mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-22 07:07:09 +01:00
29 lines
773 B
TypeScript
29 lines
773 B
TypeScript
import { notarize } from '@electron/notarize';
|
|
import type { Hooks } from 'app-builder-lib';
|
|
|
|
const notarizeAfterSignHook: Hooks['afterSign'] = context => {
|
|
const { electronPlatformName, appOutDir } = context;
|
|
|
|
if (electronPlatformName !== 'darwin') {
|
|
return;
|
|
}
|
|
|
|
if (!process.env.APPLEID || !process.env.APPLEIDPASS || !process.env.APPLETEAMID) {
|
|
return;
|
|
}
|
|
|
|
const appName = context.packager.appInfo.productFilename;
|
|
const appPath = `${appOutDir}/${appName}.app`;
|
|
|
|
console.log(`notarizing ${appPath} ...`);
|
|
|
|
return notarize({
|
|
appPath,
|
|
appleId: process.env.APPLEID,
|
|
appleIdPassword: process.env.APPLEIDPASS,
|
|
teamId: process.env.APPLETEAMID,
|
|
});
|
|
};
|
|
|
|
export default notarizeAfterSignHook;
|