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.
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
name: Flatpak
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master ]
|
|
paths:
|
|
- 'packaging/flatpak/**'
|
|
- 'src/**'
|
|
- 'pyproject.toml'
|
|
- '.github/workflows/flatpak.yml'
|
|
pull_request:
|
|
branches: [ main, master ]
|
|
paths:
|
|
- 'packaging/flatpak/**'
|
|
- 'src/**'
|
|
- 'pyproject.toml'
|
|
- '.github/workflows/flatpak.yml'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
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
|
|
matrix:
|
|
include:
|
|
- arch: x86_64
|
|
runner: ubuntu-latest
|
|
- arch: aarch64
|
|
runner: ubuntu-24.04-arm
|
|
container:
|
|
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
|
|
options: --privileged
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and bundle
|
|
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
|
with:
|
|
bundle: vocalinux-${{ matrix.arch }}.flatpak
|
|
manifest-path: packaging/flatpak/com.vocalinux.Vocalinux.yml
|
|
# 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
|