Skip to content

Commit 2d14deb

Browse files
committed
Update Mac build signing
1 parent 777d8d5 commit 2d14deb

File tree

2 files changed

+59
-9
lines changed

2 files changed

+59
-9
lines changed

.github/workflows/build.yml

+54-6
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,67 @@ jobs:
4848
env:
4949
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
5050

51-
- name: Setup notarization credentials
51+
- name: Setup notarization credentials and entitlements
5252
if: matrix.os == 'macos-latest'
5353
run: |
54-
echo ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }} | base64 --decode > notarization_api_key.p8
54+
# Save API key to file
55+
echo "${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }}" | base64 --decode > ./notarization_api_key.p8
56+
57+
# Verify API key file exists and has content
58+
if [ -s "./notarization_api_key.p8" ]; then
59+
echo "API key file created successfully"
60+
else
61+
echo "Error: API key file is empty or not created"
62+
exit 1
63+
fi
64+
65+
# Create build directory and add entitlements file
66+
mkdir -p build
67+
cat > build/entitlements.mac.plist << 'EOL'
68+
<?xml version="1.0" encoding="UTF-8"?>
69+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
70+
<plist version="1.0">
71+
<dict>
72+
<key>com.apple.security.cs.allow-jit</key>
73+
<true/>
74+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
75+
<true/>
76+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
77+
<true/>
78+
<key>com.apple.security.cs.disable-library-validation</key>
79+
<true/>
80+
<key>com.apple.security.inherit</key>
81+
<true/>
82+
<key>com.apple.security.automation.apple-events</key>
83+
<true/>
84+
</dict>
85+
</plist>
86+
EOL
5587
56-
- name: Build Electron app
57-
if: matrix.os != 'ubuntu-latest-large'
88+
- name: Build Electron app (macOS)
89+
if: matrix.os == 'macos-latest'
5890
env:
5991
DEBUG: electron-builder
6092
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
APPLE_API_KEY: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }}
6293
APPLE_API_KEY_ID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }}
63-
APPLE_API_KEY_ISSUER: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }}
94+
APPLE_API_KEY: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }}
95+
APPLE_API_ISSUER: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }}
96+
run: |
97+
# Debug: Verify environment variables are set (without exposing values)
98+
if [ -n "$APPLE_API_KEY" ]; then echo "APPLE_API_KEY is set"; else echo "APPLE_API_KEY is NOT set"; fi
99+
if [ -n "$APPLE_API_KEY_ID" ]; then echo "APPLE_API_KEY_ID is set"; else echo "APPLE_API_KEY_ID is NOT set"; fi
100+
if [ -n "$APPLE_API_ISSUER" ]; then echo "APPLE_API_ISSUER is set"; else echo "APPLE_API_ISSUER is NOT set"; fi
101+
102+
# Print electron-builder version for debugging
103+
npx electron-builder --version
104+
105+
npm run electron-build
106+
107+
- name: Build Electron app (Windows)
108+
if: matrix.os == 'windows-latest'
109+
env:
110+
DEBUG: electron-builder
111+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64112
run: npm run electron-build
65113

66114
- name: Build Electron app (Linux)

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@
145145
"icon": "public/icon.icns",
146146
"hardenedRuntime": true,
147147
"gatekeeperAssess": false,
148-
"entitlements": "build/entitlements.mac.plist",
149-
"entitlementsInherit": "build/entitlements.mac.plist",
148+
"entitlements": "./build/entitlements.mac.plist",
149+
"entitlementsInherit": "./build/entitlements.mac.plist",
150150
"notarize": {
151-
"teamId": "APPLE_TEAM_ID"
151+
"appleApiKey": "./notarization_api_key.p8",
152+
"appleApiKeyId": "$APPLE_API_KEY_ID",
153+
"appleApiIssuer": "$APPLE_API_ISSUER"
152154
}
153155
}
154156
},

0 commit comments

Comments
 (0)