From 154e0abab0156551f9288856876ee5818f13b8a1 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Sat, 14 Oct 2023 17:03:20 +0200 Subject: [PATCH] workflow: automatically generate changelog --- .github/workflows/build_release.yaml | 13 ++++++++++--- RELEASE.md | 4 ---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml index 800acbd..b33a5d4 100644 --- a/.github/workflows/build_release.yaml +++ b/.github/workflows/build_release.yaml @@ -75,6 +75,7 @@ jobs: shell: bash run: | majorVer=$(cat VERSION) + lastReleasedVer=$(git tag --sort version:refname --list "v$majorVer.*" | tail -n1) lastVer=$(git tag --sort version:refname --list "v$majorVer.*" | tail -n1) if [[ -n "$lastVer" ]]; then newVer=(${lastVer//./ }) @@ -85,9 +86,15 @@ jobs: nextVer="v$majorVer.0" fi echo "MajorVer=$majorVer LastVer=$lastVer NextVer=$nextVer" + echo "GIT_LAST_VERSION=${lastReleasedVer//v/}" >> $GITHUB_ENV echo "GIT_VERSION=${nextVer//v/}" >> $GITHUB_ENV - - name: Fix RELEASE.md version - run: sed -i 's|#{GIT_VERSION}|${{ env.GIT_VERSION }}|g' RELEASE.md + - name: Generate RELEASE details + run: | + echo "# Release ${{ env.GIT_VERSION }}" > RELEASE.tmp + echo "" >> RELEASE.tmp + git log --pretty="- %s (%h)" "${{ env.GIT_LAST_VERSION }}..HEAD" >> RELEASE.tmp + echo "" >> RELEASE.tmp + cat RELEASE.md >> RELEASE.tmp - name: 'Release debian files' uses: ncipollo/release-action@v1 with: @@ -96,4 +103,4 @@ jobs: updateOnlyUnreleased: true generateReleaseNotes: true prerelease: true - bodyFile: RELEASE.md + bodyFile: RELEASE.tmp diff --git a/RELEASE.md b/RELEASE.md index 82cf961..002f992 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,7 +1,3 @@ -# Release #{GIT_VERSION} - -- debian: support bookworm compilation - ## Variants Download correct version for your platform: