Skip to content

Commit

Permalink
macos: Enable notarization for macOS Catalina.
Browse files Browse the repository at this point in the history
This fixes the issue for Catalina users.
  • Loading branch information
kanishk98 authored and akashnimare committed Nov 13, 2019
1 parent 17d4d97 commit e7a885a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
8 changes: 8 additions & 0 deletions build/entitlements.mac.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"test"
],
"build": {
"afterSign": "./scripts/notarize.js",
"appId": "org.zulip.zulip-electron",
"asar": true,
"asarUnpack": [
Expand All @@ -57,7 +58,11 @@
"mac": {
"category": "public.app-category.productivity",
"darkModeSupport": true,
"artifactName": "${productName}-${version}-${arch}.${ext}"
"artifactName": "${productName}-${version}-${arch}.${ext}",
"hardenedRuntime": true,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist",
"gatekeeperAssess": false
},
"linux": {
"category": "Chat;GNOME;GTK;Network;InstantMessaging",
Expand Down Expand Up @@ -148,9 +153,10 @@
"cp-file": "5.0.0",
"devtron": "1.4.0",
"electron": "3.1.10",
"electron-builder": "20.40.2",
"electron-builder": "20.43.0",
"electron-connect": "0.6.2",
"electron-debug": "1.4.0",
"electron-notarize": "0.2.0",
"eslint-config-xo-typescript": "0.14.0",
"fs-extra": "8.1.0",
"gulp": "4.0.0",
Expand Down
22 changes: 22 additions & 0 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const path = require('path');
const dotenv = require('dotenv');

dotenv.config({ path: path.join(__dirname, '/../.env') });

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: 'org.zulip.zulip-electron',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASS,
});
};

0 comments on commit e7a885a

Please sign in to comment.