From 10db2ba93f1230e9813b34a268f0514e494cf257 Mon Sep 17 00:00:00 2001 From: Jatin K Malik Date: Thu, 16 Jul 2026 20:18:10 -0700 Subject: [PATCH] ci(flatpak): build arch matrix without job-level matrix if (#536) GitHub rejects job-level if expressions that reference matrix (Unrecognized named-value: matrix). Resolve the include list in a small setup job instead so PRs stay x86_64-only. --- .github/workflows/flatpak.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 44843b5..27097e0 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -22,19 +22,30 @@ concurrency: cancel-in-progress: true jobs: + # matrix is not available in job-level if; build the arch list here instead. + # PRs: x86_64 only. main / workflow_dispatch: both arches. + matrix: + name: Resolve build matrix + runs-on: ubuntu-latest + outputs: + include: ${{ steps.set.outputs.include }} + steps: + - id: set + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo 'include=[{"arch":"x86_64","runner":"ubuntu-latest"}]' >> "$GITHUB_OUTPUT" + else + echo 'include=[{"arch":"x86_64","runner":"ubuntu-latest"},{"arch":"aarch64","runner":"ubuntu-24.04-arm"}]' >> "$GITHUB_OUTPUT" + fi + build: name: Build Flatpak (${{ matrix.arch }}) - # PRs: x86_64 only. main / workflow_dispatch: both arches. - if: matrix.arch == 'x86_64' || github.event_name != 'pull_request' + needs: matrix runs-on: ${{ matrix.runner }} strategy: fail-fast: false matrix: - include: - - arch: x86_64 - runner: ubuntu-latest - - arch: aarch64 - runner: ubuntu-24.04-arm + include: ${{ fromJSON(needs.matrix.outputs.include) }} container: image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50 options: --privileged