Add production build infrastructure for macOS releases#5
Merged
Conversation
This commit adds comprehensive CI/CD infrastructure for building and distributing production-ready macOS binaries via GitHub releases. New Files: - scripts/build-release.sh: Build script for creating universal macOS binaries * Supports x86_64 + ARM64 (Apple Silicon) universal binaries * Generates SHA256 checksums for verification * Creates compressed .tar.gz archives * Works on both macOS and Linux - .github/workflows/release.yml: Automated release workflow * Triggers on version tags (e.g., v1.0.0) * Builds universal macOS binaries * Runs full test suite before release * Creates GitHub releases automatically * Uploads binaries and checksums as release assets * Generates detailed release notes with installation instructions - .github/workflows/ci.yml: Continuous integration workflow * Tests on both macOS and Linux * Runs on PRs and pushes to main/claude branches * Ensures code quality before merging - RELEASING.md: Release process documentation * Step-by-step release instructions for maintainers * Versioning guidelines (semantic versioning) * Troubleshooting guide * Manual release fallback procedures Updates: - README.md: Added CLI installation section with: * Pre-built binary installation instructions * Checksum verification steps * Build from source instructions * Requirements and dependencies - .gitignore: Added release/ directory to ignore build artifacts Features: - Universal binaries work on both Intel and Apple Silicon Macs - Automated builds ensure consistent, reproducible releases - SHA256 checksums for security verification - One-command installation for end users - Full CI/CD pipeline from tag to release Usage: To create a release, simply tag and push: git tag -a v1.0.0 -m "Release version 1.0.0" git push origin v1.0.0 The workflow will automatically build, test, and publish the release.
Changes: - Lower Swift tools version from 6.2 to 5.9 in Package.swift * Swift 6.2 is not yet available on GitHub Actions runners * The code doesn't use Swift 6.2-specific features * Swift 5.9+ is sufficient and widely available - Update CI workflow (.github/workflows/ci.yml): * macOS: Use default Xcode installation (no setup-swift needed) * Linux: Use swift-actions/setup-swift@v2 with Swift 5.9 * Add Swift version check step for debugging * Removed non-existent Xcode version selection - Update Release workflow (.github/workflows/release.yml): * macOS: Use default Xcode installation * Add Swift version check step * Removed non-existent Xcode version selection These changes ensure the workflows will run successfully on GitHub Actions with the Swift versions currently available on the runners.
Instead of using setup-swift action which can be unreliable, use the official Swift Docker container (swift:5.9) which provides a consistent and reliable Swift environment for Linux builds. Changes: - Use container: image: swift:5.9 instead of setup-swift action - Remove sudo from apt-get commands (not needed in container) - Simplified and more reliable approach for Linux testing
When using containers in GitHub Actions, git operations can fail due to ownership mismatches. This fix adds the workspace directory to git's safe.directory configuration. This is a common issue when the checkout action runs with different permissions than the container user.
Changes: - Remove claude/** branches from push trigger to prevent duplicate runs * Workflows now only run on: push to main, or pull requests to main * This prevents double-execution on PRs (push + pull_request events) - Install git before checkout step in Linux container * Swift Docker containers don't include git by default * Checkout action requires git to be installed * Moved git installation to first step, before checkout - Simplified dependency installation * Removed unnecessary git safe.directory configuration * Combined apt-get operations for efficiency
…atibility Package.resolved format version 3 was created with newer Swift toolchain on macOS and is incompatible with Swift 5.9 container on Linux CI. By removing Package.resolved from version control and letting each platform resolve dependencies independently, we ensure compatibility across different Swift versions and platforms. This is the recommended approach for cross-platform Swift projects where different toolchain versions are in use. Changes: - Removed Package.resolved from git tracking - Added Package.resolved to .gitignore - Each platform (macOS/Linux) will now resolve dependencies independently
… requirements Changes: 1. Remove libsodium from macOS workflows: - swift-sodium 0.9.1 includes bundled Clibsodium.xcframework for Apple platforms - No system libsodium installation needed on macOS - Keep libsodium-dev for Linux (required, as xcframework is Apple-only) 2. Update Swift version requirements from 6.2 to 5.9: - Package.swift already specifies swift-tools-version: 5.9 - Updated README.md: Swift 5.9+ requirement - Updated CLAUDE.md: Swift 5.9+ requirement - Clarified platform-specific dependencies 3. Clarify dependency requirements in documentation: - README.md: Clear separation of macOS (no deps) vs Linux (libsodium-dev) - CLAUDE.md: Detailed explanation of bundled vs system libsodium - Added note about expected warning on Linux builds This reduces setup friction on macOS and accurately reflects the actual build requirements for each platform.
diogot
commented
Nov 18, 2025
The git installation step is not necessary as the checkout action handles git operations without requiring git to be pre-installed in the container. Addresses PR review comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds comprehensive CI/CD infrastructure for building and distributing production-ready macOS binaries via GitHub releases.
Key Features
✅ Universal macOS binaries (x86_64 + ARM64)
✅ Automated releases triggered by version tags
✅ SHA256 checksums for security
✅ CI testing on macOS and Linux
✅ One-command installation for users
How to Release
git tag -a v1.0.0 -m "Release version 1.0.0" git push origin v1.0.0