From 0afd0a926d5fb215e76ed1df9f44598ecabf1e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20=22decko=22=20de=20Brito?= Date: Wed, 9 Jul 2025 14:30:30 -0300 Subject: [PATCH] feat: Use towncrier to generate release notes This change modifies the GitHub Actions workflow to use towncrier to generate release notes from changelog fragments and add them to the GitHub release body. Assisted-by: gemini-2.5-pro --- .../github/.github/workflows/publish.yml.j2 | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/templates/github/.github/workflows/publish.yml.j2 b/templates/github/.github/workflows/publish.yml.j2 index c95d2834..debc4c6a 100644 --- a/templates/github/.github/workflows/publish.yml.j2 +++ b/templates/github/.github/workflows/publish.yml.j2 @@ -142,11 +142,28 @@ jobs: permissions: contents: write + env: + TAG_NAME: "{{ '${{ github.ref_name }}' }}" + steps: + {{ checkout(depth=0, path=plugin_name) | indent(6) }} + + {{ setup_python(pyversion="3.11") | indent(6) }} + + - name: "Install towncrier" + run: | + pip install towncrier + + - name: "Get release notes" + id: get_release_notes + run: | + NOTES=$(towncrier build --draft --version $TAG_NAME) + echo "body<> $GITHUB_OUTPUT + echo "$NOTES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: "Create release on GitHub" uses: "actions/github-script@v7" - env: - TAG_NAME: "{{ '${{ github.ref_name }}' }}" with: script: | const { TAG_NAME } = process.env; @@ -155,5 +172,6 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, tag_name: TAG_NAME, + body: `{% raw %}${{ steps.get_release_notes.outputs.body }}{% endraw %}`, make_latest: "legacy", });