Skip to content

Commit a5eb14d

Browse files
committed
fix: use dynamic matrix for Linux targets
inputs.musl selects between musl/gnu targets directly in the matrix instead of filtering with a job-level if condition (which can't access matrix context)
1 parent ff95913 commit a5eb14d

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,30 +74,19 @@ jobs:
7474
fail-fast: false
7575
matrix:
7676
include:
77-
- target: x86_64-unknown-linux-musl
78-
os: ubuntu-latest
79-
use_musl: true
80-
- target: x86_64-unknown-linux-gnu
81-
os: ubuntu-latest
82-
use_musl: false
83-
- target: aarch64-unknown-linux-musl
84-
os: ubuntu-24.04-arm
85-
use_musl: true
86-
- target: aarch64-unknown-linux-gnu
87-
os: ubuntu-24.04-arm
88-
use_musl: false
77+
# macOS and Windows always included
8978
- target: x86_64-apple-darwin
9079
os: macos-13
91-
use_musl: false
9280
- target: aarch64-apple-darwin
9381
os: macos-14
94-
use_musl: false
9582
- target: x86_64-pc-windows-msvc
9683
os: windows-latest
97-
use_musl: false
84+
# Linux targets selected by musl input
85+
- target: ${{ inputs.musl && 'x86_64-unknown-linux-musl' || 'x86_64-unknown-linux-gnu' }}
86+
os: ubuntu-latest
87+
- target: ${{ inputs.musl && 'aarch64-unknown-linux-musl' || 'aarch64-unknown-linux-gnu' }}
88+
os: ubuntu-24.04-arm
9889
runs-on: ${{ matrix.os }}
99-
# Only run Linux builds that match the musl input; macOS/Windows always run
100-
if: ${{ !contains(matrix.target, 'unknown-linux') || matrix.use_musl == inputs.musl }}
10190
steps:
10291
- uses: actions/checkout@v4
10392

@@ -114,7 +103,7 @@ jobs:
114103
key: ${{ matrix.target }}
115104

116105
- name: Install musl tools
117-
if: matrix.use_musl
106+
if: inputs.musl && runner.os == 'Linux'
118107
run: sudo apt-get update && sudo apt-get install -y musl-tools
119108

120109
- name: Build release binary

0 commit comments

Comments
 (0)