diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index a8bbdb6..c15d464 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -25,7 +25,7 @@ jobs: - name: Abhängigkeiten installieren shell: sh run: | - apk add --no-cache bash jq git rsync zip curl + apk add --no-cache bash jq git rsync zip curl python3 - name: Daten zusammenstellen id: daten @@ -347,17 +347,25 @@ jobs: URL=${{ steps.metadata.outputs.homepage }}/releases/download/${{ steps.daten.outputs.version }}-${{ steps.daten.outputs.channel }}/${{ steps.daten.outputs.zip_file }} ENTRY="${ENTRY//\{\{URL\}\}/$URL}" - # Zeilenumbrüche →
, Bindestriche am Zeilenanfang → Bullet - CHANGELOG_HTML=$(echo "${{ steps.changelog.outputs.current }}" | \ - sed 's/&/\&/g' | \ - sed 's//\>/g' | \ - sed 's|^- \(.*\)|• \1|' | \ - tr '\n' '§' | \ - sed 's/§//g') + export CHANGELOG="${{ steps.changelog.outputs.current }}" + CHANGELOG_HTML=$(python3 - <<'EOF' + import sys, os + text = os.environ.get("CHANGELOG", "") + text = text.replace("&", "&") + text = text.replace("<", "<") + text = text.replace(">", ">") + + lines = text.splitlines() + result = "
".join(line for line in lines if line.strip()) + + print(result, end="") + EOF + ) ENTRY="${ENTRY//\{\{CHANGELOG\}\}/$CHANGELOG_HTML}" + + echo "$ENTRY" # Neue Datei erzeugen