[Flatpak] Beautify multiline strings again & Add full git commit hash (#4535)
* Don't destroy multiline strings * Use full git commit hash
This commit is contained in:
parent
d56d335c0b
commit
c09c0c002d
1 changed files with 13 additions and 3 deletions
16
.github/workflows/flatpak.yml
vendored
16
.github/workflows/flatpak.yml
vendored
|
@ -35,7 +35,7 @@ jobs:
|
||||||
id: version_info
|
id: version_info
|
||||||
working-directory: Ryujinx
|
working-directory: Ryujinx
|
||||||
run: |
|
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
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -84,7 +84,7 @@ jobs:
|
||||||
- name: Update flatpak metadata
|
- name: Update flatpak metadata
|
||||||
id: metadata
|
id: metadata
|
||||||
env:
|
env:
|
||||||
RYUJINX_GIT_HASH: ${{ steps.version_info.outputs.git_short_hash }}
|
RYUJINX_GIT_HASH: ${{ steps.version_info.outputs.git_hash }}
|
||||||
shell: python
|
shell: python
|
||||||
run: |
|
run: |
|
||||||
import hashlib
|
import hashlib
|
||||||
|
@ -94,7 +94,17 @@ jobs:
|
||||||
import yaml
|
import yaml
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from lxml import etree
|
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"
|
yaml_file = "flathub/org.ryujinx.Ryujinx.yml"
|
||||||
xml_file = "flathub/org.ryujinx.Ryujinx.appdata.xml"
|
xml_file = "flathub/org.ryujinx.Ryujinx.appdata.xml"
|
||||||
|
|
||||||
|
|
Reference in a new issue