feat(release): enhance macOS signing process in release workflow

- Added steps to ensure the signing identity is available by creating and managing a keychain for certificate import.
- Implemented security commands to unlock the keychain and import the signing certificate, improving the reliability of the signing process.
- Cleaned up temporary certificate files after use to maintain a secure environment.
This commit is contained in:
Steven Enamakel
2026-03-30 18:32:37 -07:00
parent 242a0b1e9c
commit 2e528fe32c
+15
View File
@@ -510,6 +510,21 @@ jobs:
APP_PATH="${{ steps.locate-app.outputs.app_path }}"
ENTITLEMENTS="app/src-tauri/entitlements.sidecar.plist"
# Ensure signing identity is available — re-import cert into a keychain
# in case tauri-action's keychain was cleaned up
KEYCHAIN="resign-$$.keychain-db"
KEYCHAIN_PW="$(openssl rand -base64 24)"
CERT_FILE="$(mktemp /tmp/cert-XXXXXX.p12)"
echo "$APPLE_CERTIFICATE_BASE64" | base64 --decode > "$CERT_FILE"
security create-keychain -p "$KEYCHAIN_PW" "$KEYCHAIN"
security set-keychain-settings -lut 21600 "$KEYCHAIN"
security unlock-keychain -p "$KEYCHAIN_PW" "$KEYCHAIN"
security import "$CERT_FILE" -k "$KEYCHAIN" -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PW" "$KEYCHAIN"
security list-keychains -d user -s "$KEYCHAIN" $(security list-keychains -d user | tr -d '"')
rm -f "$CERT_FILE"
echo "Signing identity imported into $KEYCHAIN"
echo "=== Re-signing binaries inside $APP_PATH with hardened runtime ==="
# Determine main executable name from Info.plist