Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

ci: import macOS signing identity components

tianma-if95bde68b0a29
diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml
index d350017f..cc49b7e7 100644
--- a/.github/workflows/desktop-build.yml
+++ b/.github/workflows/desktop-build.yml
@@ -50,14 +50,50 @@ jobs:
~/Library/Caches/electron-builder
key: ${{ runner.os }}-electron-${{ hashFiles('bun.lock', 'apps/desktop/package.json') }}
- - name: Import macOS signing certificate
- uses: apple-actions/import-codesign-certs@v3
- with:
- p12-file-base64: ${{ secrets.EDGEEVER_MAC_CERTIFICATE_BASE64 }}
- p12-password: ${{ secrets.EDGEEVER_MAC_CERTIFICATE_PASSWORD }}
-
- - name: Enable macOS certificate discovery
- run: echo "CSC_IDENTITY_AUTO_DISCOVERY=true" >> "$GITHUB_ENV"
+ - name: Import macOS signing identity
+ env:
+ MAC_CERTIFICATE_DER_BASE64: ${{ secrets.EDGEEVER_MAC_CERTIFICATE_DER_BASE64 }}
+ MAC_PRIVATE_KEY_BASE64: ${{ secrets.EDGEEVER_MAC_PRIVATE_KEY_BASE64 }}
+ run: |
+ if [[ -z "$MAC_CERTIFICATE_DER_BASE64" || -z "$MAC_PRIVATE_KEY_BASE64" ]]; then
+ echo "::error::EDGEEVER_MAC_CERTIFICATE_DER_BASE64 and EDGEEVER_MAC_PRIVATE_KEY_BASE64 are required"
+ exit 1
+ fi
+
+ keychain_path="$RUNNER_TEMP/edgeever-build.keychain-db"
+ keychain_password="$(openssl rand -hex 32)"
+ certificate_path="$RUNNER_TEMP/edgeever-mac-signing.cer"
+ private_key_path="$RUNNER_TEMP/edgeever-mac-signing.pem"
+ traditional_key_path="$RUNNER_TEMP/edgeever-mac-signing-rsa.pem"
+
+ printf '%s' "$MAC_CERTIFICATE_DER_BASE64" | base64 -D > "$certificate_path"
+ printf '%s' "$MAC_PRIVATE_KEY_BASE64" | base64 -D > "$private_key_path"
+ openssl rsa -in "$private_key_path" -traditional -out "$traditional_key_path"
+
+ security create-keychain -p "$keychain_password" "$keychain_path"
+ security set-keychain-settings -lut 21600 "$keychain_path"
+ security unlock-keychain -p "$keychain_password" "$keychain_path"
+ security import "$certificate_path" \
+ -k "$keychain_path" \
+ -f x509 \
+ -t cert \
+ -T /usr/bin/codesign
+ security import "$traditional_key_path" \
+ -k "$keychain_path" \
+ -f openssl \
+ -t priv \
+ -P '' \
+ -T /usr/bin/codesign
+ security set-key-partition-list \
+ -S apple-tool:,apple: \
+ -s \
+ -k "$keychain_password" \
+ "$keychain_path"
+ security list-keychains -d user -s "$keychain_path" "$HOME/Library/Keychains/login.keychain-db"
+ security find-identity -v -p codesigning "$keychain_path"
+
+ echo "CSC_KEYCHAIN=$keychain_path" >> "$GITHUB_ENV"
+ echo "CSC_IDENTITY_AUTO_DISCOVERY=true" >> "$GITHUB_ENV"
- name: Install dependencies
run: bun install --frozen-lockfile