From fc5c680bfb19fce5fda7b3e798e7f84c267e88b2 Mon Sep 17 00:00:00 2001 From: Nils Hjelte Date: Fri, 3 Nov 2023 10:18:15 +0100 Subject: [PATCH] Extract changelog for release --- .github/workflows/publish-release-version.yml | 4 ++++ extract_version_changelog.sh | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 extract_version_changelog.sh diff --git a/.github/workflows/publish-release-version.yml b/.github/workflows/publish-release-version.yml index 9432a49..155709f 100644 --- a/.github/workflows/publish-release-version.yml +++ b/.github/workflows/publish-release-version.yml @@ -59,9 +59,13 @@ jobs: # zip release-artifacts/hylo-lsp-client-windows-x64.zip hylo-lsp-windows-x64/hylo-lsp-client.exe ref ls -l release-artifacts + - name: Extract version changelog + run: echo "RELEASE_CHANGELOG=$(./extract_version_changelog.sh ${{ github.ref_name }})" >> $GITHUB_ENV + - name: Release uses: softprops/action-gh-release@v1 with: files: | LICENSE release-artifacts/* + body: ${{ env.RELEASE_CHANGELOG }} diff --git a/extract_version_changelog.sh b/extract_version_changelog.sh new file mode 100755 index 0000000..e58f0cc --- /dev/null +++ b/extract_version_changelog.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +start_heading="## $1" + +end_heading="#" + +# The file to process +file="CHANGELOG.md" + +awk -v start="$start_heading" -v end="$end_heading" ' + $0 ~ start {flag=1; next} + $0 ~ end {flag=0} + flag {print} +' "$file"