Skip to content

build: can force notarization on macOS if not on a CI #1916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions electron/build/scripts/notarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down