Skip to content

Commit e84ffe2

Browse files
committed
check in ignored files
1 parent a4076fc commit e84ffe2

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ testbench.yaml
99
vendor
1010
node_modules
1111
.DS_Store
12-
resources/electron/*.log

resources/electron/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea
22
node_modules
33
out
4+
*.log
5+
!build
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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-jit</key>
6+
<true/>
7+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
8+
<true/>
9+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
10+
<true/>
11+
</dict>
12+
</plist>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { notarize } from '@electron/notarize';
2+
3+
export default async (context) => {
4+
// Only notarize when process is running on a Mac
5+
if (process.platform !== 'darwin') return;
6+
7+
// And the current build target is macOS
8+
if (context.packager.platform.name !== 'mac') return;
9+
10+
console.log('aftersign hook triggered, start to notarize app.')
11+
12+
if (!('NATIVEPHP_APPLE_ID' in process.env && 'NATIVEPHP_APPLE_ID_PASS' in process.env && 'NATIVEPHP_APPLE_TEAM_ID' in process.env)) {
13+
console.warn('skipping notarizing, NATIVEPHP_APPLE_ID, NATIVEPHP_APPLE_ID_PASS and NATIVEPHP_APPLE_TEAM_ID env variables must be set.')
14+
return
15+
}
16+
17+
const appId = process.env.NATIVEPHP_APP_ID;
18+
19+
const {appOutDir} = context
20+
21+
const appName = context.packager.appInfo.productFilename
22+
23+
try {
24+
await notarize({
25+
appBundleId: appId,
26+
appPath: `${appOutDir}/${appName}.app`,
27+
appleId: process.env.NATIVEPHP_APPLE_ID,
28+
appleIdPassword: process.env.NATIVEPHP_APPLE_ID_PASS,
29+
teamId: process.env.NATIVEPHP_APPLE_TEAM_ID,
30+
tool: 'notarytool',
31+
})
32+
} catch (error) {
33+
console.error(error)
34+
}
35+
36+
console.log(`done notarizing ${appId}.`)
37+
}

0 commit comments

Comments
 (0)