Skip to content

Commit 98c8fef

Browse files
authored
Merge pull request #215 from mattfarina/sign-not
Setup to sign and notarize
2 parents 0a45d87 + fbdbc54 commit 98c8fef

6 files changed

Lines changed: 155 additions & 1 deletion

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
<!--?xml version="1.0" encoding="UTF-8"?-->
3+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
4+
<plist version="1.0">
5+
<dict>
6+
<key>com.apple.security.inherit</key>
7+
<true/>
8+
<key>com.apple.security.cs.allow-jit</key>
9+
<true/>
10+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
11+
<true/>
12+
<key>com.apple.security.cs.disable-library-validation</key>
13+
<true/>
14+
</dict>
15+
</plist>

build/entitlements.mac.plist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
<!--?xml version="1.0" encoding="UTF-8"?-->
3+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
4+
<plist version="1.0">
5+
<dict>
6+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
7+
<true/>
8+
<key>com.apple.security.cs.allow-jit</key>
9+
<true/>
10+
<key>com.apple.security.cs.disable-library-validation</key>
11+
<true/>
12+
<key>com.apple.security.hypervisor</key>
13+
<true/>
14+
</dict>
15+
</plist>

electron-builder.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
productName: Rancher Desktop
22
icon: ./resources/icons/logo-square-512.png
3-
appId: io.rancher.rancher-desktop
3+
appId: io.rancherdesktop.app
44
asar: true
55
extraResources:
66
- resources/
77
files:
88
- dist/app/**/*
9+
mac:
10+
entitlements: "build/entitlements.mac.plist"
11+
entitlementsInherit: "build/entitlements.mac.inherit.plist"
12+
darkModeSupport: true
13+
hardenedRuntime: true
14+
gatekeeperAssess: false
15+
afterSign: "scripts/notarize.js"

package-lock.json

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"electron": "^10.3.0",
6262
"electron-builder": "^22.9.1",
6363
"electron-devtools-installer": "^3.1.0",
64+
"electron-notarize": "^1.0.0",
6465
"eslint": "^7.18.0",
6566
"eslint-plugin-nuxt": "^2.0.0",
6667
"eslint-plugin-vue": "^7.4.1",

scripts/notarize.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
require('dotenv').config();
2+
const { notarize } = require('electron-notarize');
3+
4+
exports.default = async function notarizing(context) {
5+
const { electronPlatformName, appOutDir } = context;
6+
7+
if (electronPlatformName !== 'darwin') {
8+
return;
9+
}
10+
11+
const appName = context.packager.appInfo.productFilename;
12+
const appleId = process.env.APPLEID;
13+
14+
if (!appleId) {
15+
return;
16+
}
17+
18+
return await notarize({
19+
appBundleId: 'io.rancherdesktop.app',
20+
appPath: `${ appOutDir }/${ appName }.app`,
21+
appleId,
22+
appleIdPassword: process.env.AC_PASSWORD
23+
});
24+
};

0 commit comments

Comments
 (0)