From 77785051e23cec3ffd273a6a40b77a9cde657a07 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Thu, 23 Feb 2023 11:30:44 +0100 Subject: [PATCH] build: force notarization on macOS if not on a CI IDE2 needs a way to manually sign the application on M1. The 'MACOS_FORCE_NOTARIZE' env variable forces the notarization to proceed if not on a CI. Signed-off-by: Akos Kitta --- electron/build/scripts/notarize.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/electron/build/scripts/notarize.js b/electron/build/scripts/notarize.js index 05a7b64b3..ec29ec09c 100644 --- a/electron/build/scripts/notarize.js +++ b/electron/build/scripts/notarize.js @@ -3,8 +3,18 @@ const { notarize } = require('electron-notarize'); exports.default = async function notarizing(context) { if (!isCI) { - console.log('Skipping notarization: not on CI.'); - return; + if ( + typeof process.env.MACOS_FORCE_NOTARIZE === 'string' && + /true/i.test(process.env.MACOS_FORCE_NOTARIZE) + ) { + // Hack for manual M1 signing. Set the MACOS_FORCE_NOTARIZE env variable to true, to force notarization when not on a CI. The 'true' is case insensitive. + console.log( + `Detected the 'MACOS_FORCE_NOTARIZE' environment variable with '${process.env.MACOS_FORCE_NOTARIZE}' value. Forcing the app notarization, although not on a CI.` + ); + } else { + console.log('Skipping notarization: not on CI.'); + return; + } } if (process.env.CAN_SIGN === 'false') { console.log('Skipping the app notarization: certificate was not provided.');