From dea8e6854467b5a7f4f808ac95fe9580581ab241 Mon Sep 17 00:00:00 2001 From: Jatin K Malik Date: Thu, 16 Jul 2026 19:58:19 -0700 Subject: [PATCH] ci(flatpak): reuse builder cache and skip aarch64 on PRs (#535) Using github.sha in the cache key forced a full rebuild on every commit. Hash packaging/flatpak instead so .flatpak-builder can restore across runs, and only rebuild modules that actually changed. PRs build x86_64 only; main and workflow_dispatch still cover both arches. Drop the extra upload-artifact step in favor of the action's own upload. --- .github/workflows/flatpak.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 28b7526..44843b5 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -24,6 +24,8 @@ concurrency: jobs: 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' runs-on: ${{ matrix.runner }} strategy: fail-fast: false @@ -45,15 +47,12 @@ jobs: with: bundle: vocalinux-${{ matrix.arch }}.flatpak manifest-path: packaging/flatpak/com.vocalinux.Vocalinux.yml - cache-key: flatpak-${{ matrix.arch }}-${{ github.sha }} + # Stable key so .flatpak-builder cache restores across commits. + # github.sha in the key forced a full rebuild every run. + # Arch is appended automatically by the action. + cache-key: flatpak-builder-${{ hashFiles('packaging/flatpak/**') }} arch: ${{ matrix.arch }} + artifact-name: vocalinux-flatpak-${{ matrix.arch }} # Flathub mirrors screenshots at submission time; mirror locally so the # builddir linter does not flag the external screenshot URL. mirror-screenshots-url: https://dl.flathub.org/media - - - name: Upload bundle - uses: actions/upload-artifact@v4 - with: - name: vocalinux-flatpak-${{ matrix.arch }} - path: vocalinux-${{ matrix.arch }}.flatpak - if-no-files-found: error