Skip to content

Commit ffa1917

Browse files
Michael Borckclaude
andcommitted
Add macOS code signing and notarization
- Import signing certificate from GitHub secrets - Configure notarization with Apple ID credentials - Enables signed and notarized macOS builds Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e46abf2 commit ffa1917

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ jobs:
7474
- name: Build Next.js app
7575
run: npm run build
7676

77+
- name: Import macOS signing certificate
78+
if: matrix.os == 'macos-latest'
79+
env:
80+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
81+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
82+
run: |
83+
echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12
84+
security create-keychain -p actions build.keychain
85+
security default-keychain -s build.keychain
86+
security unlock-keychain -p actions build.keychain
87+
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
88+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k actions build.keychain
89+
rm certificate.p12
90+
7791
- name: Build Electron app (with retry)
7892
uses: nick-fields/retry@v3
7993
with:
@@ -82,17 +96,10 @@ jobs:
8296
retry_wait_seconds: 30
8397
command: npm run dist
8498
env:
85-
# Code signing (add your certificates as secrets)
86-
# CSC_LINK: ${{ secrets.CSC_LINK }}
87-
# CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
88-
# Windows signing
89-
# WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
90-
# WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
91-
# macOS notarization
92-
# APPLE_ID: ${{ secrets.APPLE_ID }}
93-
# APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
94-
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
9599
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
APPLE_ID: ${{ secrets.APPLE_ID }}
101+
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
102+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
96103

97104
- name: Upload build artifacts
98105
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)