Skip to content

Commit c0af297

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
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 <[email protected]>
1 parent c97e34a commit c0af297

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Diff for: electron/build/scripts/notarize.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ const { notarize } = require('electron-notarize');
33

44
exports.default = async function notarizing(context) {
55
if (!isCI) {
6-
console.log('Skipping notarization: not on CI.');
7-
return;
6+
if (
7+
typeof process.env.MACOS_FORCE_NOTARIZE === 'string' &&
8+
/true/i.test(process.env.MACOS_FORCE_NOTARIZE)
9+
) {
10+
// 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.
11+
console.log(
12+
`Detected the 'MACOS_FORCE_NOTARIZE' environment variable with '${process.env.MACOS_FORCE_NOTARIZE}' value. Forcing the app notarization, although not on a CI.`
13+
);
14+
} else {
15+
console.log('Skipping notarization: not on CI.');
16+
return;
17+
}
818
}
919
if (process.env.CAN_SIGN === 'false') {
1020
console.log('Skipping the app notarization: certificate was not provided.');

0 commit comments

Comments
 (0)