Skip to content

Commit b8eb50c

Browse files
committed
build: fix code signing issue
- fix: add default entitlements plist - move notarize code into single script with other build config
1 parent aa8083d commit b8eb50c

File tree

5 files changed

+37
-22
lines changed

5 files changed

+37
-22
lines changed

package-lock.json

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"@vue/cli-service": "^3.8.0",
6161
"@vue/eslint-config-prettier": "^4.0.1",
6262
"@vue/eslint-config-typescript": "^4.0.0",
63+
"dotenv": "^8.0.0",
6364
"electron": "^5.0.2",
6465
"electron-icon-builder": "^1.0.0",
6566
"electron-notarize": "^0.1.1",

public/entitlements.mac.plist

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
6+
<true/>
7+
</dict>
8+
</plist>

scripts/notarize.js

-16
This file was deleted.

vue.config.js

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const path = require('path')
22
const webpack = require('webpack')
3+
const { notarize } = require('electron-notarize')
4+
require('dotenv').config()
35

46
module.exports = {
57
pluginOptions: {
@@ -27,10 +29,24 @@ module.exports = {
2729
* https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/
2830
*/
2931
hardenedRuntime: true,
30-
gatekeeperAssess: false
32+
gatekeeperAssess: false,
33+
entitlements: 'public/entitlements.mac.plist',
34+
entitlementsInherit: 'public/entitlements.mac.plist'
3135
},
32-
afterSign: 'scripts/notarize.js',
33-
// Include ths OS so it's clearer which to download
36+
afterSign: async context => {
37+
const { electronPlatformName, appOutDir } = context
38+
const appName = context.packager.appInfo.productFilename
39+
40+
if (electronPlatformName === 'darwin') {
41+
return notarize({
42+
appBundleId: 'io.kava.switch',
43+
appPath: `${appOutDir}/${appName}.app`,
44+
appleId: process.env.APPLE_ID,
45+
appleIdPassword: process.env.APPLE_PASSWORD
46+
})
47+
}
48+
},
49+
// Include ths OS so it's clearer which to download from the filename
3450
artifactName: '${productName}-${os}-v${version}.${ext}'
3551
},
3652
chainWebpackRendererProcess: config => {

0 commit comments

Comments
 (0)