From 5b10de2c8d25562a57f18774bb828924f18d067b Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Fri, 8 Dec 2023 13:12:47 -0500 Subject: [PATCH 1/2] [GitHub Actions] Flatpak: Check updated appstream / metainfo path --- .ci/flatpak/build.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.ci/flatpak/build.sh b/.ci/flatpak/build.sh index 4a6bd436508..1bd8ecd2d61 100755 --- a/.ci/flatpak/build.sh +++ b/.ci/flatpak/build.sh @@ -36,16 +36,26 @@ echo " -> Size (bytes): $(stat -c %s "${WZ_FLATPAK_BUNDLE}")" WZ_FLATPAK_BUILD_PATH="${WZ_FLATPAK_BUILD_DIR}/files/share" -echo "::group::Validating: appdata/${WZ_FLATPAK_APPID}.appdata.xml" -if [ -x "$(command -v appstreamcli)" ]; then - echo "appstreamcli validate ${WZ_FLATPAK_BUILD_PATH}/appdata/${WZ_FLATPAK_APPID}.appdata.xml" - appstreamcli validate ${WZ_FLATPAK_BUILD_PATH}/appdata/${WZ_FLATPAK_APPID}.appdata.xml +WZ_FLATPAK_APPSTREAM_PATH="${WZ_FLATPAK_BUILD_PATH}/metainfo/${WZ_FLATPAK_APPID}.metainfo.xml" +if [ ! -f "${WZ_FLATPAK_APPSTREAM_PATH}" ]; then + # try the old path? + WZ_FLATPAK_APPSTREAM_PATH="${WZ_FLATPAK_BUILD_PATH}/appdata/${WZ_FLATPAK_APPID}.appdata.xml" +fi + +if [ -f "${WZ_FLATPAK_APPSTREAM_PATH}" ]; then + echo "::group::Validating appstream" + if [ -x "$(command -v appstreamcli)" ]; then + echo "appstreamcli validate ${WZ_FLATPAK_APPSTREAM_PATH}" + appstreamcli validate "${WZ_FLATPAK_APPSTREAM_PATH}" + else + # Older utility fallback + echo "appstream-util validate ${WZ_FLATPAK_APPSTREAM_PATH}" + appstream-util validate "${WZ_FLATPAK_APPSTREAM_PATH}" + fi + echo "::endgroup::" else - # Older utility fallback - echo "appstream-util validate ${WZ_FLATPAK_BUILD_PATH}/appdata/${WZ_FLATPAK_APPID}.appdata.xml" - appstream-util validate ${WZ_FLATPAK_BUILD_PATH}/appdata/${WZ_FLATPAK_APPID}.appdata.xml + echo "::warning ::Could not find appstream file to validate?" fi -echo "::endgroup::" echo "::group::Verify icon and metadata in app-info" test -f "${WZ_FLATPAK_BUILD_PATH}/app-info/icons/flatpak/128x128/${WZ_FLATPAK_APPID}.png" || { echo "Missing 128x128 icon in app-info" ; exit 1; } From 6a2e2e411f73b1dfab1bd50466cb1951c9435546 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:30:39 -0500 Subject: [PATCH 2/2] [GitHub Actions] Flatpak: Check staged screenshots --- .ci/flatpak/build.sh | 15 ++++++++++++++- .github/workflows/CI_flatpak.yml | 10 +++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.ci/flatpak/build.sh b/.ci/flatpak/build.sh index 1bd8ecd2d61..29841a8113f 100755 --- a/.ci/flatpak/build.sh +++ b/.ci/flatpak/build.sh @@ -62,6 +62,19 @@ test -f "${WZ_FLATPAK_BUILD_PATH}/app-info/icons/flatpak/128x128/${WZ_FLATPAK_AP test -f "${WZ_FLATPAK_BUILD_PATH}/app-info/xmls/${WZ_FLATPAK_APPID}.xml.gz" || { echo "Missing ${WZ_FLATPAK_APPID}.xml.gz in app-info" ; exit 1; } echo "::endgroup::" +echo "::group::Check screenshots" +if [ ! -d "${WZ_FLATPAK_BUILD_DIR}/screenshots" ]; then + echo "::notice ::Screenshots not mirrored by flatpak-builder?" +else + echo "Found screenshots:" + find "${WZ_FLATPAK_BUILD_DIR}/screenshots" -type f +fi +echo "::endgroup::" + echo "::group::Commit screenshots to the OSTree repository" -ostree commit --repo=${WZ_FLATPAK_LOCAL_REPO_NAME} --canonical-permissions --branch=screenshots/${WZ_FLATPAK_TARGET_ARCH} "${WZ_FLATPAK_BUILD_DIR}/screenshots" +if [ -d "${WZ_FLATPAK_BUILD_DIR}/screenshots" ]; then + ostree commit --repo=${WZ_FLATPAK_LOCAL_REPO_NAME} --canonical-permissions --branch=screenshots/${WZ_FLATPAK_TARGET_ARCH} "${WZ_FLATPAK_BUILD_DIR}/screenshots" +else + echo "::warning ::Screenshots not added to OSTree repository" +fi echo "::endgroup::" diff --git a/.github/workflows/CI_flatpak.yml b/.github/workflows/CI_flatpak.yml index 208d27ff99a..d75c67df8b1 100644 --- a/.github/workflows/CI_flatpak.yml +++ b/.github/workflows/CI_flatpak.yml @@ -226,6 +226,11 @@ jobs: . src/.ci/flatpak/build.sh echo "WZ_FLATPAK_LOCAL_REPO_NAME=${WZ_FLATPAK_LOCAL_REPO_NAME}" echo "WZ_FLATPAK_LOCAL_REPO_NAME=${WZ_FLATPAK_LOCAL_REPO_NAME}" >> $GITHUB_OUTPUT + - name: Output generated files listing + shell: bash + working-directory: flatpak_app/files + run: | + find . -type f - name: Lint Flatpak continue-on-error: true env: @@ -245,11 +250,6 @@ jobs: with: name: 'warzone2100_linux_flatpak_${{ matrix.arch }}' path: ${{ steps.settings.outputs.WZ_FLATPAK_BUNDLE }} - - name: Output generated files listing - shell: bash - working-directory: flatpak_app/files - run: | - find . -type f - name: Upload debug info uses: actions/upload-artifact@v3 with: