From 7b9addea2683ce7c46aafb1a914f53f90a38589b Mon Sep 17 00:00:00 2001 From: Brenden Davidson Date: Mon, 23 Jun 2025 18:21:07 -0500 Subject: [PATCH] [flatpak] Added official Flatpak GH Action to release.yml --- .github/workflows/flatpak.yml | 105 ---------------------------------- .github/workflows/release.yml | 30 ++++++++++ 2 files changed, 30 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/flatpak.yml diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml deleted file mode 100644 index 5243760d..00000000 --- a/.github/workflows/flatpak.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Build Release Flatpaks - -on: - push: - branches: - - master - - flatpak # TODO: Remove this line once the workflow has been validated to work. - -env: - APP_ID: pizza.isle.Isle - -jobs: - build: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - - env: - BUILD_DIR: "./flatpak-build" - PLATFORM: "org.kde" - PLATFORM_VERSION: 6.8 - REPO_DIR: "./isle-repo/" - - strategy: - fail-fast: false - matrix: - include: - - name: 'x86_64' - os: 'ubuntu-latest' - - # The Ubuntu ARM runner is in preview, so we may have to figure out Flatpak cross-compilation - - name: "aarch64" - os: 'ubuntu-22.04-arm' - - steps: - - name: Get Date - id: get-date - run: | - echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT - shell: bash - - - name: Cache APT repo data - id: cache-apt - uses: actions/cache@v4 - with: - path: | - /var/cache/apt/ - /var/lib/apt/lists/ - key: ${{ runner.os }}-${{ matrix.name }}-${{ steps.get-date.outputs.date }} - - - name: Update APT cache - if: steps.cache-apt.outputs.cache-hit != 'true' - run: sudo apt update - - - name: Install build dependencies - run: | - sudo apt install -y flatpak flatpak-builder - flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo - flatpak install \ - ${{ env.PLATFORM }}.Platform//${{ env.PLATFORM_VERSION }} \ - ${{ env.PLATFORM }}.Sdk//${{ env.PLATFORM_VERSION }} - - - name: Cache .flatpak-builder - id: cache-fp-builder - uses: actions/cache@v4 - with: - path: ".flatpak-builder/" - key: ${{ runner.os }}-${{ matrix.name }}-fp-builder - - - name: Build Flatpak - run: | - mkdir ${{ env.REPO_DIR }} - flatpak-builder --repo=${{ env.REPO_DIR }} ${{ env.BUILD_DIR }} flatpak/${{ env.APP_ID }}.json - - - name: Bundle Flatpak - run: flatpak build-bundle ${{ env.REPO_DIR }} ${{ env.APP_ID }}.${{ matrix.name }}.flatpak ${{ env.APP_ID }} - - - name: Upload artifact - uses: actions/upload-artifact@main - with: - name: Release-${{ matrix.name }} - path: ${{ env.APP_ID }}.${{ matrix.name }}.flatpak - - release: - name: Release - runs-on: ubuntu-latest - needs: build - steps: - - name: Download All Artifacts - uses: actions/download-artifact@main - with: - pattern: Release-* - path: Release - merge-multiple: true - - - name: Checkout uploadtool - uses: actions/checkout@v4 - with: - repository: 'probonopd/uploadtool' - path: 'uploadtool' - - - name: Upload Continuous Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - ./uploadtool/upload.sh Release/* \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e4c6cc9..2e586606 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - flatpak # TODO: Remove this line once the workflow has been validated to work. jobs: build: @@ -91,6 +92,35 @@ jobs: path: | build/dist/isle-* + flatpak: + name: "Flatpak (${{ matrix.arch }})" + runs-on: ${{ matrix.os }} + + env: + APP_ID: pizza.isle.Isle + + strategy: + fail-fast: false + matrix: + include: + - arch: x86_64 + os: ubuntu-latest + + - arch: aarch64 + os: ubuntu-22.04-arm + + container: + image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.8 + options: --privileged + + steps: + - uses: actions/checkout@v4 + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: ${{ env.APP_ID }}.${{ matrix.arch }}.flatpak + manifest-path: flatpak/${{ env.APP_ID }}.json + arch: ${{ matrix.arch }} + release: name: 'Release' runs-on: ubuntu-latest