Skip to content

Commit cb8d4cb

Browse files
author
l2l
committed
Test Mac build signing
1 parent 3992a2f commit cb8d4cb

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/build.yml

+21
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,32 @@ jobs:
3535
CI: false
3636
run: npm run react-build
3737

38+
- name: Import certificate to Keychain
39+
if: matrix.os == 'macos-latest'
40+
run: |
41+
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12
42+
KEYCHAIN_PASSWORD=$(uuidgen)
43+
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
44+
security default-keychain -s build.keychain
45+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
46+
security import ./certificate.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign
47+
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" ~/Library/Keychains/build.keychain
48+
env:
49+
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
50+
51+
- name: Setup notarization credentials
52+
if: matrix.os == 'macos-latest'
53+
run: |
54+
echo ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }} | base64 --decode > notarization_api_key.p8
55+
3856
- name: Build Electron app
3957
if: matrix.os != 'ubuntu-latest-large'
4058
env:
4159
DEBUG: electron-builder
4260
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
APPLE_API_KEY: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }}
62+
APPLE_API_KEY_ID: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }}
63+
APPLE_API_KEY_ISSUER: ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }}
4364
run: npm run electron-build
4465

4566
- name: Build Electron app (Linux)

package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,14 @@
142142
],
143143
"category": "public.app-category.developer-tools",
144144
"artifactName": "Drivechain-Launcher-${version}-${arch}.${ext}",
145-
"icon": "public/icon.icns"
145+
"icon": "public/icon.icns",
146+
"hardenedRuntime": true,
147+
"gatekeeperAssess": false,
148+
"entitlements": "build/entitlements.mac.plist",
149+
"entitlementsInherit": "build/entitlements.mac.plist",
150+
"notarize": {
151+
"teamId": "APPLE_TEAM_ID"
152+
}
146153
}
147154
},
148155
"devDependencies": {

0 commit comments

Comments
 (0)