Skip to content

Commit cb77f19

Browse files
committed
desktop: get code signing/notarizing working
1 parent 49aae24 commit cb77f19

File tree

3 files changed

+27
-31
lines changed

3 files changed

+27
-31
lines changed

.github/workflows/electron-build.yml

+13-22
Original file line numberDiff line numberDiff line change
@@ -128,32 +128,23 @@ jobs:
128128
shell: bash
129129
run: echo "VERSION=${GITHUB_REF#refs/tags/desktop-v}" >> $GITHUB_OUTPUT
130130

131-
# Code signing is disabled for now
132-
# - name: Import Code-Signing Certificates (macOS)
133-
# if: matrix.os == 'macos-latest'
134-
# uses: apple-actions/import-codesign-certs@v2
135-
# with:
136-
# p12-file-base64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
137-
# p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
138-
# keychain-password: ${{ github.run_id }}
131+
- name: Import Code-Signing Certificates (macOS)
132+
if: matrix.os == 'macos-latest'
133+
uses: apple-actions/import-codesign-certs@v2
134+
with:
135+
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
136+
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
137+
keychain-password: ${{ github.run_id }}
139138

140-
# Install electron-notarize package - re-enable when we have a Developer ID Application certificate
141-
# we'll also need to add the `afterSign` hook to electron-builder config in package.json
142-
# - name: Install @electron/notarize
143-
# if: matrix.os == 'macos-latest'
144-
# working-directory: apps/tlon-desktop
145-
# run: pnpm add @electron/notarize -D
146-
147-
# Run platform-specific electron-builder with code signing & notarization disabled
139+
# Run platform-specific electron-builder with code signing & notarization
148140
- name: Build Platform Package
149141
working-directory: apps/tlon-desktop
150142
env:
151-
# Explicitly disable code signing and notarization
152-
CSC_IDENTITY_AUTO_DISCOVERY: "false"
153-
CSC_IDENTITY: ""
154-
NOTARIZE: "false"
155-
ELECTRON_BUILDER_SIGN: "false"
156-
USE_HARD_LINKS: "false"
143+
CSC_LINK: ${{ matrix.os == 'macos-latest' && secrets.APPLE_CERTIFICATE_BASE64 || '' }}
144+
CSC_KEY_PASSWORD: ${{ matrix.os == 'macos-latest' && secrets.APPLE_CERTIFICATE_PASSWORD || '' }}
145+
APPLE_ID: ${{ matrix.os == 'macos-latest' && secrets.APPLE_ID || '' }}
146+
APPLE_APP_SPECIFIC_PASSWORD: ${{ matrix.os == 'macos-latest' && secrets.APPLE_ID_PASSWORD || '' }}
147+
APPLE_TEAM_ID: ${{ matrix.os == 'macos-latest' && secrets.APPLE_TEAM_ID || '' }}
157148
run: npx electron-builder ${{ matrix.build_flag }}
158149

159150
# Prepare artifacts with proper names

apps/tlon-desktop/package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"electron-store": "^10.0.1"
3434
},
3535
"devDependencies": {
36+
"@electron/notarize": "2.5.0",
3637
"concurrently": "^9.1.2",
3738
"electron": "34.3.0",
3839
"electron-builder": "^26.0.10",
@@ -62,10 +63,10 @@
6263
"mac": {
6364
"category": "public.app-category.social-networking",
6465
"darkModeSupport": true,
65-
"hardenedRuntime": false,
66+
"hardenedRuntime": true,
6667
"gatekeeperAssess": false,
67-
"entitlements": null,
68-
"entitlementsInherit": null,
68+
"entitlements": "resources/entitlements.mac.plist",
69+
"entitlementsInherit": "resources/entitlements.mac.plist",
6970
"icon": "resources/icons/mac/icon.icns",
7071
"target": [
7172
{
@@ -90,6 +91,7 @@
9091
"linux": {
9192
"icon": "resources/icons/png",
9293
"target": "AppImage"
93-
}
94+
},
95+
"afterSign": ".notarize.js"
9496
}
9597
}

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)