From 01d8f8dba7b290572349e2f014589203c509f97f Mon Sep 17 00:00:00 2001 From: Makito Date: Fri, 16 Jan 2026 03:08:23 +0900 Subject: [PATCH] fix(ci): matrix does not support if so skip the build via workarounds --- .github/workflows/release-tamagotchi.yml | 28 +++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-tamagotchi.yml b/.github/workflows/release-tamagotchi.yml index 0d6406486..93437ebd6 100644 --- a/.github/workflows/release-tamagotchi.yml +++ b/.github/workflows/release-tamagotchi.yml @@ -54,43 +54,51 @@ jobs: matrix: include: - - if: ${{ inputs.platform == 'all' || inputs.platform == 'macos' }} - os: macos-15-intel + - os: macos-15-intel artifact: darwin-x64 target: x86_64-apple-darwin arch: x64 builder-args: --macos --x64 + skip: ${{ inputs.platform == 'all' || inputs.platform == 'macos' }} - - if: ${{ inputs.platform == 'all' || inputs.platform == 'macos' }} - os: macos-latest + - os: macos-latest artifact: darwin-arm64 target: aarch64-apple-darwin builder-args: --macos --arm64 arch: arm64 + skip: ${{ inputs.platform == 'all' || inputs.platform == 'macos' }} - - if: ${{ inputs.platform == 'all' || inputs.platform == 'linux' }} - os: ubuntu-latest + - os: ubuntu-latest artifact: linux-x64 target: x86_64-unknown-linux-gnu builder-args: --linux --x64 arch: x64 + skip: ${{ inputs.platform == 'all' || inputs.platform == 'linux' }} - - if: ${{ inputs.platform == 'all' || inputs.platform == 'linux' }} - os: ubuntu-24.04-arm + - os: ubuntu-24.04-arm artifact: linux-arm64 target: aarch64-unknown-linux-gnu builder-args: --linux --arm64 arch: arm64 + skip: ${{ inputs.platform == 'all' || inputs.platform == 'linux' }} - - if: ${{ inputs.platform == 'all' || inputs.platform == 'windows' }} - os: windows-latest + - os: windows-latest artifact: windows-x64-setup target: x86_64-pc-windows-msvc builder-args: --windows --x64 arch: x64 + skip: ${{ inputs.platform == 'all' || inputs.platform == 'windows' }} runs-on: ${{ matrix.os }} steps: + - name: Skip the build (fail fast) + if: matrix.skip + run: | + echo "Skipping build for ${{ matrix.os }}..." + echo "This will fail the job, but don't panic—this is expected when not building for all." + echo "This will be improved in the future." + exit 1 + # Why? # # failed to build archive at `/home/runner/work/airi/airi/target/x86_64-unknown-linux-gnu/release/deps/libapp_lib.rlib`: