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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user