From c09c0c002d5bb12218bbecc02d39de84ae773793 Mon Sep 17 00:00:00 2001 From: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Date: Sun, 12 Mar 2023 10:42:33 +0100 Subject: [PATCH] [Flatpak] Beautify multiline strings again & Add full git commit hash (#4535) * Don't destroy multiline strings * Use full git commit hash --- .github/workflows/flatpak.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 7df99065..ee0cc6f9 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -35,7 +35,7 @@ jobs: id: version_info working-directory: Ryujinx run: | - echo "git_short_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "git_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 with: @@ -84,7 +84,7 @@ jobs: - name: Update flatpak metadata id: metadata env: - RYUJINX_GIT_HASH: ${{ steps.version_info.outputs.git_short_hash }} + RYUJINX_GIT_HASH: ${{ steps.version_info.outputs.git_hash }} shell: python run: | import hashlib @@ -94,7 +94,17 @@ jobs: import yaml from datetime import datetime from lxml import etree - + + + # Ensure we don't destroy multiline strings + def str_presenter(dumper, data): + if len(data.splitlines()) > 1: + return dumper.represent_scalar("tag:yaml.org,2002:str", data, style="|") + return dumper.represent_scalar("tag:yaml.org,2002:str", data) + + + yaml.representer.SafeRepresenter.add_representer(str, str_presenter) + yaml_file = "flathub/org.ryujinx.Ryujinx.yml" xml_file = "flathub/org.ryujinx.Ryujinx.appdata.xml"