From de3e102b3716ab69c3644e9cb3caa922cce6e05f Mon Sep 17 00:00:00 2001 From: SdgJlbl Date: Fri, 22 Mar 2024 17:28:10 +0100 Subject: [PATCH] chore: add towncrier for changelog management (#319) Signed-off-by: SdgJlbl --- CHANGELOG.md | 2 +- README.md | 22 ++++++++++++++++++++++ changes/319.changed | 1 + towncrier.toml | 10 ++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 changes/319.changed create mode 100644 towncrier.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index 46e465dc..7d4c1eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] + ## [0.48.0] - 2024-03-07 diff --git a/README.md b/README.md index a9baa249..4f5304d6 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,28 @@ Typically, `git tag 1.2.3 && git push origin 1.2.3` should be enough. [More info](ci/readme.md) +## How to generate the changelog + +The changelog is managed with [towncrier](https://towncrier.readthedocs.io/en/stable/index.html), a Python tool. +To add a new entry in the changelog, add a file in the `changes` folder. The file name should have the following structure: +`.`. +The `unique_id` is a unique identifier, we currently use the PR number. +The `change_type` can be of the following types: `added`, `changed`, `removed`, `fixed`. + +To generate the changelog (for example during a release), you need to have `towncrier` installed. You can either install it in a virtual env, or use `pipx` (please refer to [pipx documentation](https://github.com/pypa/pipx) for installation instructions). + +```bash +$ pipx install towncrier +``` + +Then use the following command : + +``` +towncrier build --version= +``` + +You can use the `--draft` option to see what would be generated without actually writing to the changelog (and without removing the fragments). + ## Tests ### Unit tests diff --git a/changes/319.changed b/changes/319.changed new file mode 100644 index 00000000..0c464291 --- /dev/null +++ b/changes/319.changed @@ -0,0 +1 @@ +- [chore] `towncrier` is now used for changelog management ([#319](https://github.com/Substra/substra-frontend/pull/319)) diff --git a/towncrier.toml b/towncrier.toml new file mode 100644 index 00000000..fa1d80e7 --- /dev/null +++ b/towncrier.toml @@ -0,0 +1,10 @@ +[tool.towncrier] +directory = "changes" +filename = "CHANGELOG.md" +start_string = "\n" +underlines = ["", "", ""] +title_format = "## [{version}](https://github.com/Substra/orchestrator/releases/tag/{version}) - {project_date}" +[tool.towncrier.fragment.added] +[tool.towncrier.fragment.removed] +[tool.towncrier.fragment.changed] +[tool.towncrier.fragment.fixed]