|
12 | 12 | required: false |
13 | 13 | type: string |
14 | 14 | 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" |
17 | 17 | required: false |
18 | 18 | type: string |
19 | 19 | default: "kunobi-runners" |
| 20 | + runner_macos: |
| 21 | + description: "Runner label for macOS native builds" |
| 22 | + required: false |
| 23 | + type: string |
| 24 | + default: "macos-latest" |
20 | 25 | rust_toolchain: |
21 | 26 | description: "Rust toolchain to use" |
22 | 27 | required: false |
@@ -81,10 +86,13 @@ jobs: |
81 | 86 | shell: bash |
82 | 87 | env: |
83 | 88 | TARGETS: ${{ inputs.targets }} |
| 89 | + RUNNER_LINUX: ${{ inputs.runner_linux }} |
| 90 | + RUNNER_MACOS: ${{ inputs.runner_macos }} |
84 | 91 | 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" '[.[] | { |
87 | 94 | target: ., |
| 95 | + runner: (if test("apple-darwin") then $rm else $rl end), |
88 | 96 | use_cross: (test("linux|windows")), |
89 | 97 | archive_ext: (if test("windows") then "zip" else "tar.gz" end), |
90 | 98 | binary_ext: (if test("windows") then ".exe" else "" end) |
|
96 | 104 | build: |
97 | 105 | name: Build ${{ matrix.target }} |
98 | 106 | needs: setup |
99 | | - runs-on: ${{ inputs.runner }} |
| 107 | + runs-on: ${{ matrix.runner }} |
100 | 108 | strategy: |
101 | 109 | fail-fast: false |
102 | 110 | matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} |
|
0 commit comments