Skip to content

Commit 9ff9b27

Browse files
committed
feat: github siging
1 parent 38a72ad commit 9ff9b27

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ jobs:
7676
APPLE_ID: ${{ secrets.APPLE_ID }}
7777
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
7878
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
79+
APPLE_CODESIGN_CERT_BASE64: ${{ secrets.APPLE_CODESIGN_CERT_BASE64 }}
80+
APPLE_CODESIGN_CERT_PASSWORD: ${{ secrets.APPLE_CODESIGN_CERT_PASSWORD }}
81+
APPLE_CODESIGN_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_CODESIGN_KEYCHAIN_PASSWORD }}
7982
steps:
8083
- name: Checkout
8184
uses: actions/checkout@v5
@@ -92,6 +95,26 @@ jobs:
9295
cache: "pnpm"
9396
- name: Install dependencies
9497
run: pnpm install --frozen-lockfile
98+
- name: Import code signing certificate
99+
if: env.APPLE_CODESIGN_IDENTITY != ''
100+
env:
101+
CERT_BASE64: ${{ env.APPLE_CODESIGN_CERT_BASE64 }}
102+
CERT_PASSWORD: ${{ env.APPLE_CODESIGN_CERT_PASSWORD }}
103+
KEYCHAIN_PASSWORD: ${{ env.APPLE_CODESIGN_KEYCHAIN_PASSWORD }}
104+
run: |
105+
if [ -z "$CERT_BASE64" ] || [ -z "$CERT_PASSWORD" ] || [ -z "$KEYCHAIN_PASSWORD" ]; then
106+
echo "Missing code signing certificate secrets"
107+
exit 1
108+
fi
109+
KEYCHAIN="$RUNNER_TEMP/codesign.keychain-db"
110+
echo "$CERT_BASE64" | base64 --decode > "$RUNNER_TEMP/certificate.p12"
111+
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN"
112+
security set-keychain-settings -lut 21600 "$KEYCHAIN"
113+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN"
114+
security import "$RUNNER_TEMP/certificate.p12" -k "$KEYCHAIN" -P "$CERT_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security
115+
security list-keychains -d user -s "$KEYCHAIN" $(security list-keychains -d user | tr -d '"')
116+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN"
117+
rm "$RUNNER_TEMP/certificate.p12"
95118
- name: Verify package version
96119
run: |
97120
PACKAGE_VERSION=$(jq -r .version package.json)

README.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,39 +69,34 @@ Set `ELECTRON_DISABLE_AUTO_UPDATE=1` if you ever need to ship a build with auto
6969

7070
### macOS Code Signing & Notarization
7171

72-
macOS builds are automatically signed (and optionally notarized) when the relevant environment variables are present:
72+
macOS builds are automatically signed (and optionally notarized) when the relevant environment variables are present. We standardise on Apple ID + app-specific password credentials for notarization:
7373

7474
```bash
7575
# Required for code signing
7676
export APPLE_CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)"
7777

78-
# Notarytool authentication (pick one of the following)
79-
# 1. Apple ID + app-specific password
78+
# Notarytool authentication
8079
export APPLE_ID="[email protected]"
8180
export APPLE_APP_SPECIFIC_PASSWORD="xxxx-xxxx-xxxx-xxxx"
8281
export APPLE_TEAM_ID="TEAMID"
83-
84-
# 2. App Store Connect API key
85-
export APPLE_API_KEY="-----BEGIN PRIVATE KEY-----..."
86-
export APPLE_API_KEY_ID="ABC123DEFG"
87-
export APPLE_API_ISSUER="01234567-89AB-CDEF-0123-456789ABCDEF"
88-
89-
# 3. Pre-configured keychain profile (created via `xcrun notarytool store-credentials`)
90-
export APPLE_NOTARIZE_KEYCHAIN_PROFILE="AC_PROFILE"
91-
# export APPLE_NOTARIZE_KEYCHAIN="/Users/me/Library/Keychains/login.keychain-db" # optional
9282
```
9383

9484
The signing step uses hardened runtime with the entitlements in `build/entitlements.mac.plist` and will sign the DMG plus the zipped `.app`. When the notarization variables are present, packages are also notarized. Without these variables the build proceeds unsigned, which is convenient for local development.
9585

9686
For CI releases, add the same values as GitHub Actions repository secrets:
9787

9888
- `APPLE_CODESIGN_IDENTITY`
99-
- `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, `APPLE_TEAM_ID` (or)
100-
- `APPLE_API_KEY`, `APPLE_API_KEY_ID`, `APPLE_API_ISSUER` (or)
101-
- `APPLE_NOTARIZE_KEYCHAIN_PROFILE`, `APPLE_NOTARIZE_KEYCHAIN` (optional companion secret)
89+
- `APPLE_ID`
90+
- `APPLE_APP_SPECIFIC_PASSWORD`
91+
- `APPLE_TEAM_ID`
92+
- `APPLE_CODESIGN_CERT_BASE64` - Base64 encoded `.p12` export of your Developer ID Application certificate
93+
- `APPLE_CODESIGN_CERT_PASSWORD` - Password used when exporting the `.p12`
94+
- `APPLE_CODESIGN_KEYCHAIN_PASSWORD` - Password for the temporary keychain created in CI
10295

10396
The `Publish Release` workflow will automatically sign and notarize when these secrets are present.
10497

98+
> If you prefer API-key or keychain profile credentials for notarization, the Forge configuration already supports them—add the matching env vars locally and in CI instead of the defaults above.
99+
105100
### Liquid Glass Icon (macOS 26+)
106101

107102
The app supports macOS liquid glass icons for a modern, layered appearance. The icon configuration is in `build/icon.icon/`.

0 commit comments

Comments
 (0)