Skip to content

Commit

Permalink
added notarize by apple
Browse files Browse the repository at this point in the history
  • Loading branch information
istvan-kreisz committed Jun 29, 2021
1 parent 159678c commit de46744
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"@types/node": "^15.6.1",
"@types/react": "^17.0.8",
"@types/react-dom": "^17.0.5",
"dotenv": "^10.0.0",
"electron-log": "^4.3.5",
"electron-notarize": "^1.0.0",
"electron-reload": "^1.5.0",
"electron-store": "^8.0.0",
"electron-updater": "^4.3.9",
Expand Down Expand Up @@ -52,6 +54,7 @@
"appId": "com.electron.copdeck",
"productName": "CopDeck",
"copyright": "Copyright © 2021 CopDeck",
"afterSign": "scripts/notarize.js",
"extends": null,
"files": [
"build/**/*"
Expand Down Expand Up @@ -81,7 +84,11 @@
],
"category": "public.app-category.utilities",
"type": "distribution",
"icon": "logo1024.png"
"icon": "logo1024.png",
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist",
"hardenedRuntime": true
}
},
"browserslist": {
Expand Down
14 changes: 14 additions & 0 deletions public/entitlements.mac.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
</dict>
</plist>
18 changes: 18 additions & 0 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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.electron.copdeck',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
});
};
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5106,6 +5106,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz"
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==

dotenv@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==

dotenv@^8.2.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz"
Expand Down Expand Up @@ -5186,6 +5191,14 @@ electron-log@^4.3.5:
resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.3.5.tgz"
integrity sha512-J5Ew3axdk7W4jzzxKLSAi1sqbcAoo9CzHuBVsG0tT47j256xKulNrWFf3lZmHJ1KDXOQUcuwOngQF0jjmpEdpw==

electron-notarize@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/electron-notarize/-/electron-notarize-1.0.0.tgz#bc925b1ccc3f79e58e029e8c4706572b01a9fd8f"
integrity sha512-dsib1IAquMn0onCrNMJ6gtEIZn/azG8hZMCYOuZIMVMUeRMgBYHK1s5TK9P8xAcrAjh/2aN5WYHzgVSWX314og==
dependencies:
debug "^4.1.1"
fs-extra "^9.0.1"

[email protected]:
version "22.10.5"
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-22.10.5.tgz"
Expand Down

0 comments on commit de46744

Please sign in to comment.