Skip to content

Commit

Permalink
ci: Allow flexible Rusk binary building in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
HDauven committed Dec 19, 2024
1 parent 71a27dd commit d5a2f9a
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/rusk_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,32 @@ on:
description: "Git branch, ref, or SHA to checkout"
required: true
default: "master"
runner:
description: "Choose runner target to build against (JSON array)"
required: true
default: "[\"ubuntu-24.04\", \"macos-15\", \"arm-linux\"]"
features:
description: "Choose features to build (JSON array)"
required: true
default: "[\"default\", \"archive\"]"

jobs:
build_and_publish:
name: Build Rusk binaries for ${{ matrix.os }} (${{ matrix.features }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-15, arm-linux]
compiler: [cargo]
features: [default, archive]
include:
- os: ubuntu-24.04
target: linux-x64
- os: macos-15
target: macos-arm64
flags: --target=aarch64-apple-darwin
- os: arm-linux
target: linux-arm64
flags: --target=aarch64-unknown-linux-gnu
include: ${{ fromJson('[
{"os": "ubuntu-24.04", "target": "linux-x64", "flags": ""},
{"os": "macos-15", "target": "macos-arm64", "flags": "--target=aarch64-apple-darwin"},
{"os": "arm-linux", "target": "linux-arm64", "flags": "--target=aarch64-unknown-linux-gnu"}
]') | filter(item => contains(fromJson(github.event.inputs.operating_system), item.os)) | map(item => fromJson(github.event.inputs.features) | map(features => {"os": item.os, "features": features, "target": item.target, "flags": item.flags})) | flatten }}
fail-fast: false

steps:
- name: Debug Build Flags
run: echo "Build flags: ${{ matrix.flags }}"

- name: Checkout Repository
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit d5a2f9a

Please sign in to comment.