Add cross-platform release workflow for Win/Mac/Linux builds#17
Conversation
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
|
@copilot MUST support macos-x86_64 |
The workflow already includes macOS x86_64 support - see lines 26-27 in |
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive cross-platform release automation workflow that builds and publishes BitCell binaries for Windows, macOS, and Linux platforms. The workflow leverages GitHub Actions' matrix strategy to build bitcell-node and bitcell-admin binaries across different operating systems and architectures, then automatically attaches them to GitHub releases.
Key Changes
- Adds release workflow with matrix builds for 4 platforms (Linux x86_64, macOS x86_64/ARM64, Windows x86_64)
- Implements proper security with least-privilege permissions (
contents: readfor builds,contents: writefor uploads) - Includes platform-specific artifact packaging (tar.gz for Unix, zip for Windows) with automatic release asset uploads
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - os: macos-latest | ||
| target: x86_64-apple-darwin | ||
| artifact_name: bitcell-macos-x86_64 | ||
| - os: macos-latest |
There was a problem hiding this comment.
Building aarch64-apple-darwin on macos-latest (which defaults to x86_64 runners) requires cross-compilation and may fail without additional setup. Consider either:
- Using
macos-14or newer which provides native ARM64 runners (recommended) - Adding explicit cross-compilation tooling setup for ARM64
Example fix:
- os: macos-14 # Native ARM64 runner
target: aarch64-apple-darwin
artifact_name: bitcell-macos-aarch64| - os: macos-latest | |
| - os: macos-14 # Native ARM64 runner |
| ${{ runner.os }}-${{ matrix.target }}-cargo- | ||
|
|
||
| - name: Build release binaries | ||
| run: cargo build --release --target ${{ matrix.target }} |
There was a problem hiding this comment.
The build command builds all workspace members but only the binaries (bitcell-node and bitcell-admin) are needed for releases. Consider specifying the binary packages explicitly for faster builds and clearer intent:
run: cargo build --release --target ${{ matrix.target }} -p bitcell-node -p bitcell-adminThis reduces build time by skipping unnecessary library-only crates.
| run: cargo build --release --target ${{ matrix.target }} | |
| run: cargo build --release --target ${{ matrix.target }} -p bitcell-node -p bitcell-admin |
| shell: bash | ||
| run: | | ||
| cd artifacts | ||
| tar -czvf ../${{ matrix.artifact_name }}.tar.gz ./* |
There was a problem hiding this comment.
[nitpick] The tar command uses ./* which will include the directory structure in the archive. This means extracted files will be in the current directory, which is correct. However, using * instead of ./* is more conventional and achieves the same result:
tar -czvf ../${{ matrix.artifact_name }}.tar.gz *This is a minor style preference but aligns with common tar usage patterns.
| tar -czvf ../${{ matrix.artifact_name }}.tar.gz ./* | |
| tar -czvf ../${{ matrix.artifact_name }}.tar.gz * |
|
@copilot apply changes based on the comments in this thread |
…kages, simplify tar command Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Applied all three review suggestions in commit
|
|
@copilot apply changes based on the comments in this thread |
These changes were already applied in commit |
bitcell-nodeandbitcell-adminrelease.yml) that:actionlintmacos-14for native ARM64 runner instead of cross-compilation-p bitcell-node -p bitcell-admin) for faster builds*instead of./*in tar commandOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.