build(linux): consolidate appstream metainfo (#3954)

This commit is contained in:
ReenigneArcher
2025-06-09 12:39:57 -04:00
committed by GitHub
parent b2d44f5ba9
commit c9a06fd8a7
15 changed files with 118 additions and 100 deletions

View File

@@ -264,6 +264,8 @@ jobs:
build_linux:
name: Linux ${{ matrix.type }}
env:
APP_ID: dev.lizardbyte.app.Sunshine
runs-on: ubuntu-${{ matrix.dist }}
needs: setup_release
strategy:
@@ -364,7 +366,7 @@ jobs:
chmod +x ./AppDir/AppRun
# variables
DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}"
DESKTOP_FILE="${DESKTOP_FILE:-${APP_ID}.desktop}"
ICON_FILE="${ICON_FILE:-sunshine.png}"
# AppImage

View File

@@ -133,30 +133,11 @@ jobs:
xml_file="flathub/${{ env.FLATHUB_PKG }}/${{ env.FLATHUB_PKG }}.metainfo.xml"
# Extract release information
version="${{ github.event.release.tag_name }}" && version="${version#v}"
date="${{ github.event.release.published_at }}" && date="${date%%T*}"
changelog="${{ github.event.release.body }}" && changelog="${changelog//&/&}" && \
changelog="${changelog//</&lt;}" && changelog="${changelog//>/&gt;}"
# Store the old release information into a temp file to be used for precise replacement
tmpfile=$(mktemp)
# Match the existing <release> block, replace it with the new data
awk -v version="$version" -v date="$date" -v changelog="$changelog" '
BEGIN { replaced = 0 }
/<release version=.*>/ {
if (!replaced) {
print " <release version=\"" version "\" date=\"" date "\">"
print " <description><p>" changelog "</p></description>"
print " </release>"
replaced = 1
}
}
!/<release version=.*>/ && !/<\/release>/ { print $0 }
' "$xml_file" > "$tmpfile"
# Move the updated file back to the original location
mv "$tmpfile" "$xml_file"
# Replace changelog placeholder with actual changelog
sed -i "s|<!-- changelog -->|$changelog|g" "$xml_file"
- name: Update submodule
if: >-