RELEASE NOTES: fixed body

This commit is contained in:
XargonWan 2024-11-12 14:46:37 +09:00
parent 8f364b9e69
commit c8bd579ad4

View file

@ -166,19 +166,26 @@ jobs:
RELEASE_BODY+="## Commits since last release\n" RELEASE_BODY+="## Commits since last release\n"
RELEASE_BODY+="${{ steps.get-commits.outputs.commits }}\n\n" RELEASE_BODY+="${{ steps.get-commits.outputs.commits }}\n\n"
# # Extract the latest release version and date # Define the XML file path
# LATEST_RELEASE=$(xmlstarlet sel -t -m "//release[1]" -v "@version" -o " (" -v "@date" -o ")" -n net.retrodeck.retrodeck.appdata.xml) xml_file="./net.retrodeck.retrodeck.appdata.xml"
# # Extract and format the description content # Extract the raw description content
# DESCRIPTION=$(xmlstarlet sel -t -m "//release[1]/description/*" \ raw_description=$(xmlstarlet sel -t -m "/component/releases/release[1]/description/*" -c "." -n "$xml_file")
# -i "self::p" -o "\n### " -v "." -o "\n" \
# -i "self::ul/li" -o "- " -v "." -o "\n" \
# net.retrodeck.retrodeck.appdata.xml)
# RELEASE_BODY+="# Release Notes\nVersion: $LATEST_RELEASE\n\n$DESCRIPTION" # Convert <p> tags to markdown headers using sed and place headers correctly
markdown_description=$(echo "$raw_description" | sed -e 's|<p>|\n### |g' -e 's|</p>||g')
# Output the release body for GitHub Actions # Convert <li> tags to bullet points and remove leading spaces
echo "release_body=$RELEASE_BODY" >> $GITHUB_OUTPUT markdown_description=$(echo "$markdown_description" | sed -e 's|<ul>||g' -e 's|</ul>||g' -e 's|<li>|- |g' -e 's|</li>||g' | awk '{$1=$1;print}')
# Remove any remaining XML tags
markdown_description=$(echo "$markdown_description" | sed -e 's/<[^>]*>//g')
# Append markdown content with proper formatting
RELEASE_BODY+="$markdown_description\n"
# Use printf to preserve newlines and output to GITHUB_OUTPUT
printf "release_body<<EOF\n%s\nEOF\n" "$RELEASE_BODY" >> $GITHUB_OUTPUT
- name: "Build flatpak: download only" - name: "Build flatpak: download only"
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only.sh" run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/flatpak_build_download_only.sh"