diff --git a/build/notarize.js b/build/notarize.js index acf45d78..9e98e18c 100644 --- a/build/notarize.js +++ b/build/notarize.js @@ -1,9 +1,20 @@ -exports.default = function(context) { - const { execSync } = require('child_process') + - if (process.platform === "win32") { - console.log('VMP signing start') - execSync('python3 -m castlabs_evs.vmp sign-pkg ' + context.appOutDir,{stdio: 'inherit'}) - console.log('VMP signing complete') - } -} \ No newline at end of file +require('dotenv').config(); + const { notarize } = require('electron-notarize'); + +exports.default = async function notarizing(context) { + const { electronPlatformName, appOutDir } = context; + if (electronPlatformName !== 'darwin') { + return; + } + + const appName = context.packager.appInfo.productFilename; + + return await notarize({ + appBundleId: 'com.ciderapp.cider', + appPath: `${appOutDir}/${appName}.app`, + appleId: process.env.APPLEID, + appleIdPassword: process.env.APPLEIDPASS, + }); +}; \ No newline at end of file diff --git a/package.json b/package.json index 5fc6d3cf..d7d62b75 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,8 @@ "electron-acrylic-window": "^0.5.11", "electron-fetch": "^1.7.4", "electron-log": "^4.4.3", + "electron-notarize": "^1.1.1", + "electron-packager": "^15.4.0", "electron-store": "^8.0.1", "electron-updater": "^4.6.1", "electron-window-state": "^5.0.3", @@ -82,6 +84,7 @@ }, "appId": "cider", "afterPack": "./build/afterPack.js", + "afterSign": "./build/notarize.js", "protocols": [ { "name": "Cider", @@ -131,6 +134,8 @@ "buildResources": "." }, "mac": { + "hardenedRuntime": true, + "gatekeeperAssess": false, "icon": "./resources/icons/icon.icns", "category": "public.app-category.music", "entitlements": "build/entitlements.mac.plist",