42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: 🚀 GitHub Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
create_release:
|
|
name: 📦 GitHub Release erstellen
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: 📥 Repository klonen
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 📝 Release Notes aus CHANGELOG extrahieren
|
|
id: changelog
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
echo "📌 Version: $VERSION"
|
|
|
|
BODY=$(awk -v version="$VERSION" '
|
|
BEGIN { found = 0 }
|
|
$0 ~ "## \\[v"version"\\]" { found = 1; next }
|
|
$0 ~ /^## \[v[0-9]+\.[0-9]+\.[0-9]+\]/ && found { exit }
|
|
found { print }
|
|
' CHANGELOG.md)
|
|
|
|
BODY_ESCAPED="${BODY//'%'/'%25'}"
|
|
BODY_ESCAPED="${BODY_ESCAPED//$'\n'/'%0A'}"
|
|
BODY_ESCAPED="${BODY_ESCAPED//$'\r'/'%0D'}"
|
|
|
|
echo "body=$BODY_ESCAPED" >> $GITHUB_OUTPUT
|
|
|
|
- name: 🚀 GitHub Release veröffentlichen
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: ${{ github.ref_name }}
|
|
body: ${{ steps.changelog.outputs.body }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|