From 8e767640916ffe18ec4d7d3f07096bf0fc6fac5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 12 Jul 2023 15:26:00 +0200 Subject: [PATCH] Use sections config for changelogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of generating the changelog for each section Signed-off-by: Kévin Commaille --- changelogs/pyproject.toml | 34 +++++++++++++++++++++++++++++++++- changelogs/template.md.jinja | 3 --- scripts/generate-changelog.sh | 11 ++--------- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/changelogs/pyproject.toml b/changelogs/pyproject.toml index 91f7f56b..d42c96d6 100644 --- a/changelogs/pyproject.toml +++ b/changelogs/pyproject.toml @@ -1,6 +1,6 @@ [tool.towncrier] version = "unused" - filename = "../rendered.md" + filename = "rendered.md" template = "template.md.jinja" [[tool.towncrier.type]] @@ -32,3 +32,35 @@ directory = "clarification" name = "Spec Clarifications" showcontent = true + + [[tool.towncrier.section]] + name = "Client-Server API" + path = "client_server" + + [[tool.towncrier.section]] + name = "Server-Server API" + path = "server_server" + + [[tool.towncrier.section]] + name = "Application Service API" + path = "application_service" + + [[tool.towncrier.section]] + name = "Identity Service API" + path = "identity_service" + + [[tool.towncrier.section]] + name = "Push Gateway API" + path = "push_gateway" + + [[tool.towncrier.section]] + name = "Room Versions" + path = "room_versions" + + [[tool.towncrier.section]] + name = "Appendices" + path = "appendices" + + [[tool.towncrier.section]] + name = "Internal Changes/Tooling" + path = "internal" diff --git a/changelogs/template.md.jinja b/changelogs/template.md.jinja index 1e3ee6c2..38de4b92 100644 --- a/changelogs/template.md.jinja +++ b/changelogs/template.md.jinja @@ -1,6 +1,3 @@ -{% if versiondata.name %} -### {{ versiondata.name }} -{% endif %} {% for section_name, section in sections.items() %} {% if section_name %} diff --git a/scripts/generate-changelog.sh b/scripts/generate-changelog.sh index 73e59940..45132619 100755 --- a/scripts/generate-changelog.sh +++ b/scripts/generate-changelog.sh @@ -13,15 +13,8 @@ cd `dirname $0`/../changelogs # Pre-cleanup just in case it wasn't done on the last run rm -f rendered.md -# Reversed order so that room versions ends up on the bottom -towncrier --name "Internal Changes/Tooling" --dir "./internal" --config "./pyproject.toml" --yes -towncrier --name "Appendices" --dir "./appendices" --config "./pyproject.toml" --yes -towncrier --name "Room Versions" --dir "./room_versions" --config "./pyproject.toml" --yes -towncrier --name "Push Gateway API" --dir "./push_gateway" --config "./pyproject.toml" --yes -towncrier --name "Identity Service API" --dir "./identity_service" --config "./pyproject.toml" --yes -towncrier --name "Application Service API" --dir "./application_service" --config "./pyproject.toml" --yes -towncrier --name "Server-Server API" --dir "./server_server" --config "./pyproject.toml" --yes -towncrier --name "Client-Server API" --dir "./client_server" --config "./pyproject.toml" --yes +# Generate changelog +towncrier --yes { # Prepare the header