From 5d02e88702914fa870e2529dfa4496498f858e8a Mon Sep 17 00:00:00 2001 From: Samuel Imolorhe Date: Sun, 24 Sep 2023 22:54:21 +0200 Subject: [PATCH] restore custom notarize script --- packages/altair-electron/electron-builder.yml | 2 +- packages/altair-electron/scripts/notarize.js | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 packages/altair-electron/scripts/notarize.js diff --git a/packages/altair-electron/electron-builder.yml b/packages/altair-electron/electron-builder.yml index b12c2e8c20..55267bd23f 100644 --- a/packages/altair-electron/electron-builder.yml +++ b/packages/altair-electron/electron-builder.yml @@ -9,7 +9,7 @@ files: - '!**/*.ts' - '!**/*.ts.map' - '!**/*.js.map' -afterSign: electron-builder-notarize +afterSign: scripts/notarize.js mac: artifactName: ${name}_${version}_${arch}_${os}.${ext} category: public.app-category.developer-tools diff --git a/packages/altair-electron/scripts/notarize.js b/packages/altair-electron/scripts/notarize.js new file mode 100644 index 0000000000..e6bc48d9d7 --- /dev/null +++ b/packages/altair-electron/scripts/notarize.js @@ -0,0 +1,22 @@ +require('dotenv').config(); +const { notarize } = require('@electron/notarize'); +const path = require('path'); + +exports.default = async function notarizing(context) { + const { electronPlatformName, appOutDir } = context; + if (electronPlatformName !== 'darwin') { + return; + } + + const appName = context.packager.appInfo.productFilename; + + console.log('Notarizing application'); + await notarize({ + tool: 'notarytool', + // appBundleId: 'com.xkoji.altair', + appPath: path.resolve(appOutDir, `${appName}.app`), + appleId: process.env.APPLE_ID, + appleIdPassword: process.env.APPLE_ID_PASSWORD, + teamId: process.env.APPLE_TEAM_ID, + }).then(res => console.log('Notarization completed!') || res); +};