File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,30 +133,11 @@ jobs:
133133 xml_file="flathub/${{ env.FLATHUB_PKG }}/${{ env.FLATHUB_PKG }}.metainfo.xml"
134134
135135 # Extract release information
136- version="${{ github.event.release.tag_name }}" && version="${version#v}"
137- date="${{ github.event.release.published_at }}" && date="${date%%T*}"
138136 changelog="${{ github.event.release.body }}" && changelog="${changelog//&/&}" && \
139137 changelog="${changelog//</<}" && changelog="${changelog//>/>}"
140138
141- # Store the old release information into a temp file to be used for precise replacement
142- tmpfile=$(mktemp)
143-
144- # Match the existing <release> block, replace it with the new data
145- awk -v version="$version" -v date="$date" -v changelog="$changelog" '
146- BEGIN { replaced = 0 }
147- /<release version=.*>/ {
148- if (!replaced) {
149- print " <release version=\"" version "\" date=\"" date "\">"
150- print " <description><p>" changelog "</p></description>"
151- print " </release>"
152- replaced = 1
153- }
154- }
155- !/<release version=.*>/ && !/<\/release>/ { print $0 }
156- ' "$xml_file" > "$tmpfile"
157-
158- # Move the updated file back to the original location
159- mv "$tmpfile" "$xml_file"
139+ # Replace changelog placeholder with actual changelog
140+ sed -i "s|<!-- changelog -->|$changelog|g" "$xml_file"
160141
161142 - name : Update submodule
162143 if : >-
You can’t perform that action at this time.
0 commit comments