rsora ef03d3f583 Disable code signing when workflows run from forks
- Skip Mac/Win code signing and Apple notarization only if PR comes from a fork
- Disable workflows entirely if the user enabled Github Actions in
their fork repo
- Add steps to help Mac users to test their forked code in BUILDING.md
2021-03-15 16:01:37 +01:00

29 lines
903 B
JavaScript

const isCI = require('is-ci');
const { notarize } = require('electron-notarize');
exports.default = async function notarizing(context) {
if (!isCI) {
console.log('Skipping notarization: not on CI.');
return;
}
if (process.env.IS_FORK === 'true') {
console.log('Skipping the app notarization: building from a fork.');
return;
}
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== 'darwin') {
return;
}
const appName = context.packager.appInfo.productFilename;
const appBundleId = context.packager.config.appId;
console.log(`>>> Notarizing ${appBundleId} at ${appOutDir}/${appName}.app...`);
return await notarize({
appBundleId,
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.AC_USERNAME,
appleIdPassword: process.env.AC_PASSWORD,
});
};