From 97ea3f3d671bf5f0374733b37a5069cc06f1cc17 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Mon, 31 Jul 2023 04:43:43 -0700 Subject: [PATCH] generate release notes changelog text --- .github/release_template.md | 6 +++--- .github/workflows/github-release.yml | 12 +++++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/release_template.md b/.github/release_template.md index a47628b3c..eb1c43146 100644 --- a/.github/release_template.md +++ b/.github/release_template.md @@ -20,7 +20,7 @@ Announcements ### Annc 1 - +Text ### PSAs @@ -58,8 +58,8 @@ Generated release notes ====================
- New tools, fixes, and improvements +New tools, fixes, and improvements -RELEASE NOTES HERE +%RELEASE_NOTES%
diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index e37960ef1..3adec790a 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -48,6 +48,16 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ github.event.inputs.tag }} + submodules: true + - name: Generate release text + run: | + python docs/gen_changelog.py -a + TOKEN_LINE=$(grep -Fhne '%RELEASE_NOTES%' .github/release_template.md | sed 's/:.*//') + head -n $((TOKEN_LINE - 1)) .github/release_template.md > release_body.md + CHANGELOG_LINES=$(wc -l > release_body.md + tail -n 2 .github/release_template.md >> release_body.md + cat release_body.md - name: Stage win64 release uses: actions/download-artifact@v3 with: @@ -70,7 +80,7 @@ jobs: uses: ncipollo/release-action@v1 with: artifacts: "dfhack-*" - bodyFile: ".github/release_template.md" + bodyFile: "release_body.md" allowUpdates: true artifactErrorsFailBuild: true draft: true