Skip to content

Commit

Permalink
ci: Add Rusk build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
HDauven committed Dec 11, 2024
1 parent e67917b commit 4c5e0b2
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/rusk_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Compile Rusk Binaries

on:
workflow_dispatch:
inputs:
dusk_blockchain_ref:
description: "Git branch, ref, or SHA to checkout"
required: true
default: "master"

jobs:
build_and_publish:
name: Build Rusk binaries for ${{ matrix.os }} (${{ matrix.features }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-12, arm-linux]
compiler: [cargo]
features: [default, archive]
include:
- os: ubuntu-24.04
target: linux-x64-libssl3
- os: macos-12
target: macos-arm64
flags: --target=aarch64-apple-darwin
- os: arm-linux
target: linux-arm64
flags: --target=aarch64-unknown-linux-gnu

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.dusk_blockchain_ref }}

- name: Install Rust toolchain
uses: dsherret/rust-toolchain-file@v1

- name: Add ARM target for Apple silicon
run: rustup target add aarch64-apple-darwin
if: ${{ matrix.os == 'macos-12' }}

- name: Build Rusk binary
shell: bash
working-directory: ./rusk
run: cargo build --release --features "${{ matrix.features }}" ${{ matrix.flags }}

- name: Extract Version
run: |
export SEMVER=$(cargo pkgid --manifest-path ./rusk/Cargo.toml | perl -lpe 's/.*\@(.*)/$1/')
echo "SEMVER=$SEMVER" >> $GITHUB_ENV
- name: Package Binaries
run: |
mkdir rusk-${{ env.SEMVER }}-${{ matrix.target }}-${{ matrix.features }}
mv target/release/rusk rusk-${{ env.SEMVER }}-${{ matrix.target }}-${{ matrix.features }}
tar -czvf rusk-${{ env.SEMVER }}-${{ matrix.target }}-${{ matrix.features }}.tar.gz \
rusk-${{ env.SEMVER }}-${{ matrix.target }}-${{ matrix.features }}
- name: Upload Binaries as Artifacts
uses: actions/upload-artifact@v3
with:
name: rusk-binaries-${{ env.SEMVER }}-${{ matrix.target }}-${{ matrix.features }}
path: ./*.tar.gz
retention-days: 5

0 comments on commit 4c5e0b2

Please sign in to comment.