From 9bb591b6a1ec6cd9d7061d75d427830001d030ac Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 20 Feb 2025 20:26:18 -0500 Subject: [PATCH] ci(flatpak): use local exceptions --- .github/workflows/CI.yml | 49 ++++--------------- packaging/linux/flatpak/README.md | 21 +++++--- packaging/linux/flatpak/exceptions.json | 8 +++ .../flatpak-lint-baseline_manifest.json | 9 ---- .../flatpak/flatpak-lint-baseline_repo.json | 11 ----- 5 files changed, 33 insertions(+), 65 deletions(-) create mode 100644 packaging/linux/flatpak/exceptions.json delete mode 100644 packaging/linux/flatpak/flatpak-lint-baseline_manifest.json delete mode 100644 packaging/linux/flatpak/flatpak-lint-baseline_repo.json diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7ffcd306356..967532ff92f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -227,52 +227,23 @@ jobs: - name: Lint Flatpak working-directory: build run: | + exceptions_file="${{ github.workspace }}/packaging/linux/flatpak/exceptions.json" + echo "Linting flatpak manifest" flatpak run --command=flatpak-builder-lint org.flatpak.Builder \ - manifest ${APP_ID}.yml > _flatpak-lint-exceptions_manifest.json || true + --exceptions \ + --user-exceptions "${exceptions_file}" \ + manifest \ + ${APP_ID}.yml echo "Linting flatpak repo" # TODO: add arg # --mirror-screenshots-url=https://dl.flathub.org/media \ flatpak run --command=flatpak-builder-lint org.flatpak.Builder \ - repo repo > _flatpak-lint-exceptions_repo.json || true - - checks=(manifest repo) - exit_code=0 - - # check if files are equal - for check in "${checks[@]}"; do - echo "Validating $check" - - # load baseline and result files - baseline="${{ github.workspace }}/packaging/linux/flatpak/flatpak-lint-baseline_${check}.json" - result="_flatpak-lint-exceptions_${check}.json" - - # Extract errors from both JSON files - readarray -t result_errors < <(jq -r '.errors[]' "$result") - readarray -t baseline_errors < <(jq -r '.errors[]' "$baseline") - - # Loop through result errors and check against baseline errors - for error in "${result_errors[@]}"; do - if printf '%s\n' "${baseline_errors[@]}" | grep -q -F "$error"; then - echo "::warning:: '$error'" - else - echo "::error:: '$error'" - exit_code=1 - fi - done - done - - # if exit code is not 0, print results - if [ $exit_code -ne 0 ]; then - echo "Manifest lint results:" - cat _flatpak-lint-exceptions_manifest.json - echo "Repo lint results:" - cat _flatpak-lint-exceptions_repo.json - fi - - # exit with the correct code - exit $exit_code + --exceptions \ + --user-exceptions "${exceptions_file}" \ + repo \ + repo - name: Package Flathub repo archive # copy files required to generate the Flathub repo diff --git a/packaging/linux/flatpak/README.md b/packaging/linux/flatpak/README.md index a503a3465b8..684f986e65e 100644 --- a/packaging/linux/flatpak/README.md +++ b/packaging/linux/flatpak/README.md @@ -1,13 +1,22 @@ -# Overview +
+ +

Sunshine

+

Self-hosted game stream host for Moonlight.

+
-[![Flathub installs](https://img.shields.io/flathub/downloads/dev.lizardbyte.app.Sunshine?style=for-the-badge&logo=flathub)](https://flathub.org/apps/dev.lizardbyte.app.Sunshine) -[![Flathub Version](https://img.shields.io/flathub/v/dev.lizardbyte.app.Sunshine?style=for-the-badge&logo=flathub)](https://flathub.org/apps/dev.lizardbyte.app.Sunshine) +
+ Flathub installs + Flathub Version +
-LizardByte has the full documentation hosted on [Read the Docs](https://docs.lizardbyte.dev/projects/sunshine). - -## About +## ℹ️ About Sunshine is a self-hosted game stream host for Moonlight. +LizardByte has the full documentation hosted on [Read the Docs](https://docs.lizardbyte.dev/projects/sunshine) + +* [Stable](https://docs.lizardbyte.dev/projects/sunshine/latest/) +* [Beta](https://docs.lizardbyte.dev/projects/sunshine/master/) + This repo is synced from the upstream [Sunshine](https://github.com/LizardByte/Sunshine) repo. Please report issues and contribute to the upstream repo. diff --git a/packaging/linux/flatpak/exceptions.json b/packaging/linux/flatpak/exceptions.json new file mode 100644 index 00000000000..957f73849e5 --- /dev/null +++ b/packaging/linux/flatpak/exceptions.json @@ -0,0 +1,8 @@ +{ + "dev.lizardbyte.app.Sunshine": [ + "appstream-missing-screenshots", + "appstream-screenshots-not-mirrored-in-ostree", + "external-gitmodule-url-found", + "finish-args-flatpak-spawn-access" + ] +} diff --git a/packaging/linux/flatpak/flatpak-lint-baseline_manifest.json b/packaging/linux/flatpak/flatpak-lint-baseline_manifest.json deleted file mode 100644 index f1ff672259e..00000000000 --- a/packaging/linux/flatpak/flatpak-lint-baseline_manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "errors": [ - "finish-args-flatpak-spawn-access" - ], - "info": [ - "finish-args-flatpak-spawn-access: finish-args has a talk-name access for org.freedesktop.Flatpak" - ], - "message": "Please consult the documentation at https://docs.flathub.org/docs/for-app-authors/linter" -} diff --git a/packaging/linux/flatpak/flatpak-lint-baseline_repo.json b/packaging/linux/flatpak/flatpak-lint-baseline_repo.json deleted file mode 100644 index 92d24feb051..00000000000 --- a/packaging/linux/flatpak/flatpak-lint-baseline_repo.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "errors": [ - "appstream-missing-screenshots", - "finish-args-flatpak-spawn-access" - ], - "info": [ - "appstream-missing-screenshots: Catalogue file has no screenshots. Please check if screenshot URLs are reachable", - "finish-args-flatpak-spawn-access: finish-args has a talk-name access for org.freedesktop.Flatpak" - ], - "message": "Please consult the documentation at https://docs.flathub.org/docs/for-app-authors/linter" -}