Release Process Documentation
Overview
Terraphim AI uses an automated release pipeline that builds, signs, notarizes, and publishes binaries across multiple platforms.
Release Types
| Tag Format | Trigger | Artifacts |
|------------|---------|-----------|
| v* | Main release | All platforms + Homebrew update |
| terraphim_server-v* | Server-only | Server binaries only |
| terraphim-ai-desktop-v* | Desktop-only | Desktop apps only |
| terraphim_agent-v* | TUI-only | TUI binaries only |
Prerequisites
Required Credentials (stored in 1Password)
-
Apple Developer (
TerraphimPlatformvault)apple.developer.certificate- Developer ID Application certificate- Fields:
base64(certificate),password(export password)
- Fields:
apple.developer.credentials- Apple ID and notarization credentials- Fields:
username(Apple ID),APPLE_TEAM_ID,APPLE_APP_SPECIFIC_PASSWORD
- Fields:
-
GitHub (
TerraphimPlatformvault)homebrew-tap-token- GitHub PAT withreposcope- Field:
token
- Field:
-
GitHub Secrets
OP_SERVICE_ACCOUNT_TOKEN- 1Password service account tokenDOCKERHUB_USERNAME- Docker Hub username (optional)
Required Infrastructure
- Self-hosted macOS Runners:
[self-hosted, macOS, X64]- Intel Mac for x86_64 builds[self-hosted, macOS, ARM64]- M-series Mac for arm64 builds + signing
Release Steps
1. Create Release Tag
# For a full release
# For a specific component
2. Automated Pipeline Execution
The release-comprehensive.yml workflow automatically:
-
Builds Binaries (parallel)
- Linux: x86_64-gnu, x86_64-musl, aarch64-musl, armv7-musl
- macOS: x86_64 (Intel), aarch64 (Apple Silicon)
- Windows: x86_64-msvc
-
Creates Universal macOS Binaries
- Combines x86_64 + aarch64 using
lipo - Produces single binary that runs on all Macs
- Combines x86_64 + aarch64 using
-
Signs and Notarizes macOS Binaries
- Signs with Developer ID Application certificate
- Adds hardened runtime (
--options runtime) - Submits to Apple for notarization
- Waits for Apple approval (~2-10 minutes)
- Verifies with
codesign --verifyandspctl --assess
-
Builds Debian Packages
terraphim-server_*.debterraphim-agent_*.debterraphim-ai-desktop_*.deb
-
Builds Tauri Desktop Apps
- macOS:
.dmgand.app - Linux:
.AppImageand.deb - Windows:
.msiand.exe
- macOS:
-
Builds Docker Images
- Multi-arch: linux/amd64, linux/arm64, linux/arm/v7
- Ubuntu 20.04 and 22.04 variants
- Pushed to
ghcr.io/terraphim/terraphim-server
-
Creates GitHub Release
- Uploads all binaries with checksums
- Generates release notes with asset descriptions
- Marks pre-releases (alpha/beta/rc tags)
-
Updates Homebrew Formulas (for
v*tags only)- Downloads checksums from release
- Updates
terraphim/homebrew-terraphimrepository - Updates
terraphim-server.rbandterraphim-agent.rb - Commits and pushes with automation message
Workflow Jobs
build-binaries (matrix: 8 targets)
βββ Linux: x86_64-gnu, x86_64-musl, aarch64-musl, armv7-musl
βββ macOS: x86_64 (Intel runner), aarch64 (ARM runner)
βββ Windows: x86_64-msvc
β
create-universal-macos
βββ Combines macOS x86_64 + aarch64 β universal binary
β
sign-and-notarize-macos
βββ Import certificate from 1Password
βββ Sign with codesign --options runtime
βββ Submit to Apple notarization service
βββ Verify signature and Gatekeeper acceptance
β
create-release
βββ Download all artifacts
βββ Generate checksums
βββ Create GitHub Release with signed binaries
β
update-homebrew (only for v* tags)
βββ Clone terraphim/homebrew-terraphim
βββ Update formula versions and SHA256 checksums
βββ Push to GitHub with homebrew-tap-tokenManual Testing
Test Signing Locally
# Build a binary
# Test signing script
# Verify signature
Test Homebrew Installation
# Test tap
# Test installation
# Verify binaries run
# Verify signatures (macOS only)
Troubleshooting
Signing Failures
Issue: security: SecKeychainCreate: A keychain with the same name already exists
- Solution: Temporary keychain from previous run wasn't cleaned up
- Fix:
security delete-keychain /tmp/signing-test/signing.keychain-db
Issue: base64: invalid input
- Solution: Base64 certificate in 1Password has newlines
- Fix: Regenerate with
base64 certificate.p12 | tr -d '\n'and update 1Password
Issue: Notarization rejected
- Solution: Check notarization log
- Fix:
xcrun notarytool log <submission-id> --keychain-profile "..." - Common issues: Missing
--options runtime, unsigned dependencies
Homebrew Update Failures
Issue: homebrew-tap-token not found in 1Password
- Solution: Token not created or wrong vault/name
- Fix: Create GitHub PAT with
reposcope, store inTerraphimPlatform/homebrew-tap-token
Issue: Formula update fails with authentication error
- Solution: GitHub PAT expired or insufficient permissions
- Fix: Regenerate PAT with
reposcope, update in 1Password
Release Workflow Failures
Issue: Workflow doesn't trigger on tag push
- Solution: Tag format doesn't match pattern
- Fix: Use
v*,terraphim_server-v*, etc. format
Issue: Self-hosted runner offline
- Solution: macOS runner not available
- Fix: Check runner status, restart if needed
Post-Release Checklist
- [ ] Verify GitHub Release created with all artifacts
- [ ] Check Docker images published to ghcr.io
- [ ] Test Homebrew installation on macOS
- [ ] Verify macOS binaries are signed and notarized
- [ ] Update CHANGELOG.md with release notes
- [ ] Announce release on Discord/Discourse
- [ ] Update documentation if needed
Rollback
If a release needs to be rolled back:
- Delete the tag:
- Delete the GitHub Release (UI or CLI):
- Revert Homebrew formulas (if updated):
Security Notes
- All credentials stored in 1Password (never in Git)
- Apple Developer ID certificate has 5-year expiration
- GitHub PATs should be rotated annually
- Self-hosted runners must be secured (firewalled, monitored)
- Signed binaries ensure authenticity and prevent tampering