# SPDX-License-Identifier: MIT # Flatpak bundle for x86_64 and aarch64, built in Flathub's GNOME container. Runs when the # manifest changes, on demand, and on vX.Y.Z tags (the bundle is then attached to the release). name: Flatpak on: push: branches: [main] paths: ["packaging/flatpak/**", ".github/workflows/flatpak.yml"] tags: ["v*"] workflow_dispatch: permissions: contents: write jobs: flatpak: name: Flatpak ${{ matrix.arch }} strategy: fail-fast: false matrix: include: - arch: x86_64 runner: ubuntu-24.04 - arch: aarch64 runner: ubuntu-24.04-arm runs-on: ${{ matrix.runner }} container: image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-51 options: --privileged steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: bundle: OpenPU.flatpak # artifact: OpenPU-.flatpak manifest-path: packaging/flatpak/io.github.openpu.OpenPU.yml arch: ${{ matrix.arch }} cache-key: flatpak-builder-${{ matrix.arch }}-${{ hashFiles('packaging/flatpak/*.yml') }} - name: Smoke test run: | flatpak install --user -y --noninteractive --bundle OpenPU.flatpak flatpak run --command=openpu-cli io.github.openpu.OpenPU --version flatpak run --command=sh io.github.openpu.OpenPU -c 'ls -l /app/share/locale/fr/LC_MESSAGES/openpu.mo /app/share/icons/hicolor/scalable/apps/io.github.openpu.OpenPU.svg /app/share/metainfo/io.github.openpu.OpenPU.metainfo.xml /app/lib/libgtkmm-4.0.so.0' - name: Attach to the release if: startsWith(github.ref, 'refs/tags/v') env: GH_TOKEN: ${{ github.token }} TAG: ${{ github.ref_name }} run: | git config --global --add safe.directory "$PWD" bundle="OpenPU-${TAG#v}-${{ matrix.arch }}.flatpak" mv OpenPU.flatpak "$bundle" gh release view "$TAG" >/dev/null 2>&1 || gh release create "$TAG" --verify-tag --title "OpenPU ${TAG#v}" --notes-from-tag || gh release view "$TAG" >/dev/null gh release upload "$TAG" "$bundle" --clobber