Skip to content

Add code signing, notarization, and CI/CD automation#15

Merged
qaid merged 3 commits into
mainfrom
qaid/signing-cicd-prep
Mar 15, 2026
Merged

Add code signing, notarization, and CI/CD automation#15
qaid merged 3 commits into
mainfrom
qaid/signing-cicd-prep

Conversation

@qaid

@qaid qaid commented Mar 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add production code signing with Developer ID Application certificate and Hardened Runtime entitlements
  • Implement GitHub Actions workflows for automated building (on every push/PR) and releasing (on version tags)
  • Create sign-and-package.sh script for local DMG creation with notarization
  • Update deploy.sh to use proper signing instead of ad-hoc

Setup Required

To use the GitHub Actions workflows, add these repository secrets:

  • DEVELOPER_ID_CERTIFICATE_P12 (base64-encoded .p12 certificate)
  • DEVELOPER_ID_CERTIFICATE_PASSWORD (certificate export password)
  • SIGNING_IDENTITY (your signing identity string)
  • APPLE_ID (your Apple ID email)
  • APPLE_TEAM_ID (your team ID)
  • APPLE_APP_PASSWORD (app-specific notarization password)

For local builds, store notarization credentials:

xcrun notarytool store-credentials spook-notary

Release process: git tag v1.0.0 && git push origin v1.0.0

🤖 Generated with Claude Code

Implement production-ready code signing with Developer ID Application certificate, Hardened Runtime entitlements, and notarization support. Add GitHub Actions workflows for automated building and releasing via signed DMG. Update deploy.sh to use proper production signing instead of ad-hoc.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@qaid

qaid commented Mar 15, 2026

Copy link
Copy Markdown
Owner Author

Code review

Found 3 issues:

  1. deploy.sh now fails for any developer without a specific Developer ID certificate. The previous ad-hoc signing (--sign -) worked universally; the hardcoded identity breaks the documented deploy workflow (CLAUDE.md says "Deploy (build + bundle .app): ./deploy.sh").

spook/deploy.sh

Lines 36 to 44 in 8929f5a

echo "Code signing..."
SIGNING_IDENTITY="Developer ID Application: Qaid Jacobs (NC9DMTN36B)"
ENTITLEMENTS="Resources/Spook.entitlements"
codesign --force --deep --sign "$SIGNING_IDENTITY" \
--options runtime \
--entitlements "$ENTITLEMENTS" \
--timestamp \
"$APP_PATH"

  1. com.apple.security.cs.allow-unsigned-executable-memory entitlement is unjustified for a pure Swift app. Spook uses system commands (netstat, nettop, lsof) and SQLite -- none of which require writable+executable memory. This weakens Hardened Runtime and may cause notarization issues. Consider removing it unless there is a specific need.

<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>

  1. The "Notarize DMG" step in release.yml does not use set -e. If xcrun notarytool submit fails (bad credentials, network error), the workflow continues to xcrun stapler staple on an un-notarized DMG, then uploads a broken artifact that Gatekeeper will reject. Note that scripts/sign-and-package.sh correctly uses set -e.

- name: Notarize DMG
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
run: |
xcrun notarytool submit "$DMG_PATH" \
--apple-id "$APPLE_ID" \
--team-id "$APPLE_TEAM_ID" \
--password "$APPLE_APP_PASSWORD" \
--wait
xcrun stapler staple "$DMG_PATH"

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

qaid and others added 2 commits March 15, 2026 22:25
… add error handling

- deploy.sh: read SIGNING_IDENTITY from env, fall back to ad-hoc signing when unset
- sign-and-package.sh: require SIGNING_IDENTITY via env instead of hardcoding
- Spook.entitlements: remove unjustified allow-unsigned-executable-memory
- release.yml: add set -e to notarize step to fail fast on errors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add @mainactor to DetailView so its computed properties can access
the @MainActor-isolated appTraffic property on NetworkMonitor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@qaid qaid merged commit dc82010 into main Mar 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant