Skip to content

Commit

Permalink
ci: Switch Flatpak build to flathub-infra/flatpak-github-actions
Browse files Browse the repository at this point in the history
Flathub team has recently forked flatpak-github-actions and merged
various PRs submitted to the original repo. However, it's not versioned
(yet?), so pin the latest commit instead.

Additionally, enable validation of the build using flatpak-builder-lint,
and run all steps in the container with the runtime and required tooling
baked in.
  • Loading branch information
barthalion committed Feb 21, 2024
1 parent ce5e66a commit aa6262c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 80 deletions.
33 changes: 11 additions & 22 deletions .github/workflows/linux_build_flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
build_linux:
name: ${{ inputs.jobName }}
runs-on: ${{ inputs.os }}
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.6
options: --privileged
timeout-minutes: 60

steps:
Expand Down Expand Up @@ -81,29 +84,23 @@ jobs:
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: ./.github/workflows/scripts/common/name-artifacts.sh

- name: Install Packages
env:
COMPILER: ${{ inputs.compiler }}
run: .github/workflows/scripts/linux/install-packages-flatpak.sh

- name: Download patches
run: |
cd bin/resources
aria2c -Z "${{ inputs.patchesUrl }}/patches.zip"
wget "${{ inputs.patchesUrl }}/patches.zip"
- name: Generate AppStream XML
run: |
./.github/workflows/scripts/linux/generate-metainfo.sh .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
cat .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
flatpak run org.freedesktop.appstream-glib validate .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
flatpak-builder-lint appstream .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
- name: Validate manifest
run: |
flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
flatpak-builder-lint org.flatpak.Builder manifest .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
- name: Build Flatpak
# TODO - based on v6.3, switch back to the main action once change is accepted (or they release a breaking change that uses upload-artifact@v4)
uses: xTVaser/flatpak-github-actions/flatpak-builder@64267d4cf01f7955a40128039d0abab17bb48aac
uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
with:
bundle: ${{ steps.artifact-metadata.outputs.artifact-name }}.flatpak
upload-artifact: false
Expand All @@ -117,29 +114,21 @@ jobs:
restore-cache: true
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json') }}

- name: Commit screenshots to OSTree
- name: Validate build
run: |
ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 flatpak_app/screenshots
#- name: Validate build directory
# run: |
# flatpak run --command=flatpak-builder-lint org.flatpak.Builder builddir flatpak_app
#
#- name: Validate repo
# run: |
# flatpak run --command=flatpak-builder-lint org.flatpak.Builder repo repo
flatpak-builder-lint org.flatpak.Builder --exceptions repo flatpak_app
- name: Push to Flathub beta
if: inputs.publish == true && inputs.branch == 'beta'
uses: flatpak/flatpak-github-actions/flat-manager@v6.3
uses: flathub-infra/flatpak-github-actions/flat-manager@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
with:
flat-manager-url: https://hub.flathub.org/
repository: beta
token: ${{ secrets.FLATHUB_BETA_TOKEN }}

- name: Push to Flathub stable
if: inputs.publish == true && inputs.branch == 'stable'
uses: flatpak/flatpak-github-actions/flat-manager@v6.3
uses: flathub-infra/flatpak-github-actions/flat-manager@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
with:
flat-manager-url: https://hub.flathub.org/
repository: stable
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/scripts/linux/install-packages-flatpak.sh

This file was deleted.

0 comments on commit aa6262c

Please sign in to comment.