mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-27 08:51:27 +02:00
ci(linux): build and publish Flatpak on release and path-gated PR CI
Add a ubuntu-24.04 linux-flatpak job that runs build_flatpak.sh from the shared love payload, wire it into release staging/upload, and mirror a path-gated Flatpak build in ci.yml when flatpak packaging changes.
This commit is contained in:
@@ -333,6 +333,56 @@ jobs:
|
|||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
linux-flatpak-changes:
|
||||||
|
name: detect Linux Flatpak changes
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
changed: ${{ steps.paths.outputs.changed }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- id: paths
|
||||||
|
env:
|
||||||
|
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
|
||||||
|
HEAD_SHA: ${{ github.sha }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$BASE_SHA" ] || [ "$BASE_SHA" = "0000000000000000000000000000000000000000" ]; then
|
||||||
|
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep -Eq '^(scripts/build_flatpak\.sh$|flatpak/|scripts/pack_love\.sh$|docs/linux-flatpak\.md$|\.github/workflows/(ci|release)\.yml$)'; then
|
||||||
|
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
linux-flatpak-build:
|
||||||
|
name: Linux Flatpak build
|
||||||
|
needs: linux-flatpak-changes
|
||||||
|
if: needs.linux-flatpak-changes.outputs.changed == 'true'
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: Install flatpak-builder deps
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y flatpak flatpak-builder elfutils imagemagick
|
||||||
|
- name: Build Flatpak bundle
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
scripts/build_flatpak.sh --version 0.0.0
|
||||||
|
- name: Upload the Flatpak
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: gen1recomp-linux-flatpak
|
||||||
|
path: |
|
||||||
|
dist/flatpak/gen1recomp-0.0.0-linux.flatpak
|
||||||
|
dist/flatpak/gen1recomp-0.0.0-linux.flatpak.sha256
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
headless:
|
headless:
|
||||||
name: headless suites (no ROM)
|
name: headless suites (no ROM)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -173,6 +173,38 @@ jobs:
|
|||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
linux-flatpak:
|
||||||
|
name: build Linux Flatpak
|
||||||
|
needs: [version, love-payload]
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: Install flatpak-builder deps
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y flatpak flatpak-builder elfutils imagemagick
|
||||||
|
- name: Download shared payload
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: gen1recomp-release-love
|
||||||
|
path: .bazinga/work
|
||||||
|
- name: Build Flatpak bundle
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
scripts/build_flatpak.sh \
|
||||||
|
--version "${{ needs.version.outputs.version }}" \
|
||||||
|
--game-love .bazinga/work/game.love
|
||||||
|
- name: Upload Flatpak release
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: gen1recomp-linux-flatpak-release
|
||||||
|
path: |
|
||||||
|
dist/flatpak/gen1recomp-${{ needs.version.outputs.version }}-linux.flatpak
|
||||||
|
dist/flatpak/gen1recomp-${{ needs.version.outputs.version }}-linux.flatpak.sha256
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
xbox-uwp:
|
xbox-uwp:
|
||||||
name: build Xbox UWP release
|
name: build Xbox UWP release
|
||||||
needs: [version, love-payload]
|
needs: [version, love-payload]
|
||||||
@@ -287,7 +319,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [version, love-payload, xbox-uwp, linux-arm64, native-tls-win]
|
needs: [version, love-payload, xbox-uwp, linux-arm64, linux-flatpak, native-tls-win]
|
||||||
runs-on: ${{ fromJSON(github.repository == 'bryanthaboi/gen1recomp' && '["self-hosted", "macOS"]' || '"macos-latest"') }}
|
runs-on: ${{ fromJSON(github.repository == 'bryanthaboi/gen1recomp' && '["self-hosted", "macOS"]' || '"macos-latest"') }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -498,6 +530,13 @@ jobs:
|
|||||||
name: gen1recomp-linux-arm64-release
|
name: gen1recomp-linux-arm64-release
|
||||||
path: dist/linux-arm64
|
path: dist/linux-arm64
|
||||||
|
|
||||||
|
- name: Download Linux Flatpak release
|
||||||
|
if: github.repository == 'bryanthaboi/gen1recomp'
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: gen1recomp-linux-flatpak-release
|
||||||
|
path: dist/flatpak
|
||||||
|
|
||||||
- name: Stage release assets
|
- name: Stage release assets
|
||||||
if: github.repository == 'bryanthaboi/gen1recomp'
|
if: github.repository == 'bryanthaboi/gen1recomp'
|
||||||
id: assets
|
id: assets
|
||||||
@@ -525,7 +564,7 @@ jobs:
|
|||||||
chmod +x "$outdir/gen1recomp-${v}-linux-arm64.AppImage"
|
chmod +x "$outdir/gen1recomp-${v}-linux-arm64.AppImage"
|
||||||
|
|
||||||
flatpak_bundle="dist/flatpak/gen1recomp-${v}-linux.flatpak"
|
flatpak_bundle="dist/flatpak/gen1recomp-${v}-linux.flatpak"
|
||||||
[ -f "$flatpak_bundle" ] || { echo "::error::$flatpak_bundle not found (expected from scripts/build_flatpak.sh)"; exit 1; }
|
[ -f "$flatpak_bundle" ] || { echo "::error::$flatpak_bundle not found (expected from the linux-flatpak job)"; exit 1; }
|
||||||
cp "$flatpak_bundle" "$outdir/gen1recomp-${v}-linux.flatpak"
|
cp "$flatpak_bundle" "$outdir/gen1recomp-${v}-linux.flatpak"
|
||||||
apk="$(find dist/android/release -name '*.apk' | head -1)"
|
apk="$(find dist/android/release -name '*.apk' | head -1)"
|
||||||
[ -n "$apk" ] || { echo "::error::no Android APK found under dist/android/release"; exit 1; }
|
[ -n "$apk" ] || { echo "::error::no Android APK found under dist/android/release"; exit 1; }
|
||||||
|
|||||||
@@ -43,4 +43,9 @@ scripts/build_flatpak.sh --version X.Y.Z
|
|||||||
Requires `flatpak` + `flatpak-builder` and the Freedesktop 24.08 runtime from
|
Requires `flatpak` + `flatpak-builder` and the Freedesktop 24.08 runtime from
|
||||||
Flathub (installed automatically on first build).
|
Flathub (installed automatically on first build).
|
||||||
|
|
||||||
|
Release CI builds the bundle on `ubuntu-24.04` (`linux-flatpak` job) from the
|
||||||
|
shared `game.love` payload and publishes `gen1recomp-<ver>-linux.flatpak`
|
||||||
|
alongside the AppImages. PR CI path-gates the same script when `flatpak/` or
|
||||||
|
`scripts/build_flatpak.sh` change.
|
||||||
|
|
||||||
Flathub store submission is out of scope for the GitHub bundle channel.
|
Flathub store submission is out of scope for the GitHub bundle channel.
|
||||||
|
|||||||
Reference in New Issue
Block a user