chore: improve notarizing

This commit is contained in:
Johannes Millan 2019-10-06 03:46:37 +02:00
parent e82fa01aa9
commit f3dcf6732b
2 changed files with 24 additions and 7 deletions

View file

@ -8,5 +8,11 @@
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>

View file

@ -1,5 +1,6 @@
require('dotenv').config();
const {notarize} = require('electron-notarize');
const fs = require('fs');
exports.default = async function notarizing(context) {
const {electronPlatformName, appOutDir} = context;
@ -7,12 +8,22 @@ exports.default = async function notarizing(context) {
return;
}
const appName = context.packager.appInfo.productFilename;
let appPath = `${appOutDir}/${appName}.app`;
if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}
return await notarize({
appBundleId: 'com.super-productvity.app',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
});
const appName = context.packager.appInfo.productFilename;
console.log(`Notarizing ${appName}`);
try {
await notarize({
appBundleId: 'com.super-productvity.app',
appPath,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
});
} catch (e) {
console.error(e);
}
console.log(`Notarizing DONE`);
};