From 973bdf8df98bd00cbdbefcff4a26b250fd71f561 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Tue, 17 Mar 2026 16:49:43 +0000 Subject: [PATCH] Extract only latest release block for GitHub release body --- .github/workflows/publish_nuget.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_nuget.yml b/.github/workflows/publish_nuget.yml index ec53ba5..b3b878a 100644 --- a/.github/workflows/publish_nuget.yml +++ b/.github/workflows/publish_nuget.yml @@ -32,6 +32,17 @@ jobs: - name: Push Packages run: dotnet nuget push "output/*.nupkg" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json + - name: "Extract latest release notes" + shell: pwsh + run: | + $content = Get-Content RELEASE_NOTES.md -Raw + # Match from the first #### heading to just before the second one + if ($content -match '(?s)(####.+?)(?=\n####|\z)') { + $Matches[1].Trim() | Set-Content RELEASE_NOTES_LATEST.md + } else { + $content | Set-Content RELEASE_NOTES_LATEST.md + } + - name: release uses: actions/create-release@v1 id: create_release @@ -40,7 +51,7 @@ jobs: prerelease: false release_name: 'Akka.Serialization.MessagePack ${{ github.ref_name }}' tag_name: ${{ github.ref }} - body_path: RELEASE_NOTES.md + body_path: RELEASE_NOTES_LATEST.md env: GITHUB_TOKEN: ${{ github.token }}