45 lines
1.2 KiB
YAML
45 lines
1.2 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: 🧪 Python vorbereiten
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- 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)
|
|
|
|
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
|
|
echo "$BODY" >> $GITHUB_ENV
|
|
echo "EOF" >> $GITHUB_ENV
|
|
|
|
- name: 🚀 GitHub Release veröffentlichen
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: ${{ github.ref_name }}
|
|
body: ${{ env.RELEASE_BODY }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|