CI script: Auto-fill release name and changes from changelog

This commit is contained in:
Daniel Wolf
2025-04-03 09:19:11 +02:00
parent c4aa1a73ee
commit ef0f21ed5f

View File

@@ -77,6 +77,18 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
steps: steps:
- name: Checkout changelog
uses: actions/checkout@v4
with:
sparse-checkout: CHANGELOG.md
- name: Extract changelog data
run: |
# Store the release name in env.releaseName
HEADER=$(awk '/^## / {sub(/^## /, ""); print; exit}' CHANGELOG.md)
echo "releaseName=$HEADER" >> $GITHUB_ENV
# Store the changelog body in changes.txt
awk '/^## / {if (found) exit; found=1; next} found' CHANGELOG.md > changes.txt
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
@@ -85,6 +97,8 @@ jobs:
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
draft: true draft: true
name: ${{ env.releaseName }}
body_path: changes.txt
files: "*.zip" files: "*.zip"
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}