Skip to content

Commit 583765a

Browse files
committed
fix: split runner input into runner_linux and runner_macos
macOS native builds need a macOS runner (for Xcode toolchain), while Linux/Windows cross-compilation needs a Linux runner with Docker. The setup job now computes the correct runner per target in the matrix.
1 parent cba9cbf commit 583765a

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/_release-rust.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ on:
1212
required: false
1313
type: string
1414
default: '["x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl", "x86_64-pc-windows-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin"]'
15-
runner:
16-
description: "Runner label for all build jobs"
15+
runner_linux:
16+
description: "Runner label for Linux/Windows cross-compilation jobs"
1717
required: false
1818
type: string
1919
default: "kunobi-runners"
20+
runner_macos:
21+
description: "Runner label for macOS native builds"
22+
required: false
23+
type: string
24+
default: "macos-latest"
2025
rust_toolchain:
2126
description: "Rust toolchain to use"
2227
required: false
@@ -81,10 +86,13 @@ jobs:
8186
shell: bash
8287
env:
8388
TARGETS: ${{ inputs.targets }}
89+
RUNNER_LINUX: ${{ inputs.runner_linux }}
90+
RUNNER_MACOS: ${{ inputs.runner_macos }}
8491
run: |
85-
# For each target, compute: use_cross, archive_ext, binary_ext
86-
MATRIX=$(echo "$TARGETS" | jq -c '[.[] | {
92+
# For each target, compute: runner, use_cross, archive_ext, binary_ext
93+
MATRIX=$(echo "$TARGETS" | jq -c --arg rl "$RUNNER_LINUX" --arg rm "$RUNNER_MACOS" '[.[] | {
8794
target: .,
95+
runner: (if test("apple-darwin") then $rm else $rl end),
8896
use_cross: (test("linux|windows")),
8997
archive_ext: (if test("windows") then "zip" else "tar.gz" end),
9098
binary_ext: (if test("windows") then ".exe" else "" end)
@@ -96,7 +104,7 @@ jobs:
96104
build:
97105
name: Build ${{ matrix.target }}
98106
needs: setup
99-
runs-on: ${{ inputs.runner }}
107+
runs-on: ${{ matrix.runner }}
100108
strategy:
101109
fail-fast: false
102110
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}

0 commit comments

Comments
 (0)