Build Binaries #219
Workflow file for this run
This file contains 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
name: Build Binaries | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- .github/workflows/build-binaries.yml | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
arch: amd64 | |
- os: macos-13 | |
arch: amd64 | |
- os: ubuntu-arm64-4-core | |
arch: arm64 | |
- os: macos-latest | |
arch: amd64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: | | |
vm/rust | |
core/rust | |
starknet/compiler/rust | |
- name: Set version info | |
run: | | |
echo "TAG=$(git describe --tags)" >> $GITHUB_ENV | |
echo "ARTIFACT_NAME=juno-${{ env.TAG }}-${{ runner.os }}-${{ matrix.arch }}" >> $GITHUB_ENV | |
- name: Install dependencies (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -y upx-ucl build-essential libjemalloc-dev libjemalloc2 libbz2-dev | |
- name: Install dependencies (macOS) | |
if: runner.os == 'macOS' | |
run: brew install jemalloc | |
- name: Build binary | |
run: make juno | |
- name: Compress binary (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
upx build/juno | |
mv build/juno ${{ env.ARTIFACT_NAME }} | |
- name: Prepare binary (macOS) | |
if: runner.os == 'macOS' | |
run: mv build/juno ${{ env.ARTIFACT_NAME }} | |
- name: Generate checksum | |
run: | | |
if [[ "${{ runner.os }}" == "macOS" ]]; then | |
shasum -a 256 ${{ env.ARTIFACT_NAME }} | |
else | |
sha256sum ${{ env.ARTIFACT_NAME }} | |
fi > ${{ env.ARTIFACT_NAME }}.sha256 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: | | |
${{ env.ARTIFACT_NAME }} | |
${{ env.ARTIFACT_NAME }}.sha256 | |
retention-days: 5 |