From ef0f21ed5f788e3acfe82ead3ca667e0ff58450e Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Thu, 3 Apr 2025 09:19:11 +0200 Subject: [PATCH] CI script: Auto-fill release name and changes from changelog --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7bac56..d04624f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,18 @@ jobs: runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') 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 uses: actions/download-artifact@v4 with: @@ -85,6 +97,8 @@ jobs: uses: softprops/action-gh-release@v2 with: draft: true + name: ${{ env.releaseName }} + body_path: changes.txt files: "*.zip" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}