Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(release): sign and gate macOS DMGs

Louis Beaumontbb3d646f45e3
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 01eb90926..f41d1f2c9 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -1479,18 +1479,10 @@ jobs:
DMG_PATH="${BUNDLE_DIR}/dmg/screenpipe_${VERSION}_${PACKAGE_ARCH}.dmg"
.github/scripts/create-headless-dmg.sh "$APP_PATH" "$DMG_PATH" "screenpipe"
- - name: Clean up signing cert from login keychain (macOS)
- if: matrix.os_type == 'macos' && always()
- shell: bash
- run: |
- # Remove build keychain to avoid accumulating certs across builds
- BUILD_KC="$HOME/Library/Keychains/build.keychain-db"
- security delete-keychain "$BUILD_KC" 2>/dev/null || true
- security list-keychain -d user -s ~/Library/Keychains/login.keychain-db 2>/dev/null || true
-
- name: Notarize and staple DMGs (macOS)
if: matrix.os_type == 'macos'
env:
+ APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
@@ -1566,6 +1558,11 @@ jobs:
echo "=== Notarizing and stapling DMGs ==="
for dmg in "${BUNDLE_DIR}"/dmg/*.dmg; do
if [ -f "$dmg" ]; then
+ echo "Signing: $(basename "$dmg")"
+ codesign --force --sign "$APPLE_SIGNING_IDENTITY" --timestamp \
+ --identifier "screenpi.pe.dmg" "$dmg"
+ codesign --verify --verbose=2 "$dmg"
+
echo "Notarizing: $(basename "$dmg")"
submission_id="$(submit_for_notarization "$dmg")"
wait_for_notarization "$submission_id"
@@ -1575,7 +1572,8 @@ jobs:
echo "Verifying: $(basename "$dmg")"
xcrun stapler validate "$dmg"
- spctl --assess --type open --context context:primary-signature --verbose "$dmg" 2>&1 || true
+ codesign --verify --verbose=2 "$dmg"
+ spctl --assess --type open --context context:primary-signature --verbose "$dmg"
echo "✅ $(basename "$dmg") notarized and stapled"
fi
done
@@ -1691,7 +1689,7 @@ jobs:
xcrun stapler staple "$app"
xcrun stapler validate "$app"
- spctl --assess --type execute --verbose "$app" 2>&1 || true
+ spctl --assess --type execute --verbose "$app"
# Rebuild updater tarball so Tauri updater ships the stapled .app.
TARBALL="${MACOS_DIR}/${APP_NAME}.tar.gz"
@@ -1802,3 +1800,11 @@ jobs:
fi
echo "Uploading debug symbols to Sentry..."
sentry-cli debug-files upload --org $SENTRY_ORG --project screenpipe-app apps/screenpipe-app-tauri/src-tauri/target/${{ matrix.target }}/release/
+
+ - name: Clean up build keychain (macOS)
+ if: matrix.os_type == 'macos' && always()
+ shell: bash
+ run: |
+ BUILD_KC="$HOME/Library/Keychains/build.keychain-db"
+ security delete-keychain "$BUILD_KC" 2>/dev/null || true
+ security list-keychain -d user -s ~/Library/Keychains/login.keychain-db 2>/dev/null || true
diff --git a/.github/workflows/release-enterprise.yml b/.github/workflows/release-enterprise.yml
index cc5fb57be..9a61f7e5e 100644
--- a/.github/workflows/release-enterprise.yml
+++ b/.github/workflows/release-enterprise.yml
@@ -1094,15 +1094,22 @@ jobs:
- name: Notarize and staple DMG
env:
+ APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
+ set -euo pipefail
TARGET="${{ matrix.target }}"
BUNDLE_DIR="apps/screenpipe-app-tauri/src-tauri/target/${TARGET}/release/bundle"
for dmg in "${BUNDLE_DIR}"/dmg/*.dmg; do
if [ -f "$dmg" ]; then
+ echo "Signing: $(basename "$dmg")"
+ codesign --force --sign "$APPLE_SIGNING_IDENTITY" --timestamp \
+ --identifier "screenpi.pe.enterprise.dmg" "$dmg"
+ codesign --verify --verbose=2 "$dmg"
+
echo "Notarizing: $(basename "$dmg")"
# Retry transient Apple-notary failures (same class as the .pkg
# step below). `if xcrun ...; then` keeps `set -e` from aborting
@@ -1124,7 +1131,8 @@ jobs:
echo "Stapling: $(basename "$dmg")"
xcrun stapler staple "$dmg"
xcrun stapler validate "$dmg"
- spctl --assess --type open --context context:primary-signature --verbose "$dmg" 2>&1 || true
+ codesign --verify --verbose=2 "$dmg"
+ spctl --assess --type open --context context:primary-signature --verbose "$dmg"
echo "$(basename "$dmg") notarized and stapled"
fi
done