diff --git a/.ci/flatpak/build.sh b/.ci/flatpak/build.sh index 4a6bd436508..29841a8113f 100755 --- a/.ci/flatpak/build.sh +++ b/.ci/flatpak/build.sh @@ -36,22 +36,45 @@ 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; } 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: