diff --git a/CHANGELOG.md b/CHANGELOG.md index c2f67cc51..808317d09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +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.44.0](https://github.com/Substra/substra-backend/releases/tag/0.44.0) 2024-03-07 diff --git a/README.md b/README.md index b2e831ec0..dee040c19 100644 --- a/README.md +++ b/README.md @@ -223,6 +223,22 @@ Install [pre-commit](https://pre-commit.com/), then run: pre-commit install ``` +## How to generate the changelog + +The changelog is managed with [towncrier](https://towncrier.readthedocs.io/en/stable/index.html). +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), use the following command (you must have the dev dependencies installed): + +``` +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). + ## Companion repositories The Substra platform is built from several components (see the [architecture](https://doc.substra.ai/architecture.html) documentation for a comprehensive overview): diff --git a/backend/dev-requirements.txt b/backend/dev-requirements.txt index f2f0680bf..8bdb8f62f 100644 --- a/backend/dev-requirements.txt +++ b/backend/dev-requirements.txt @@ -22,4 +22,5 @@ djangorestframework-stubs==1.8.0 django-stubs==1.14.0 celery-types==0.22.0 docker==6.1.3 -celery[pytest] \ No newline at end of file +celery[pytest] +towncrier==23.11.0 diff --git a/changes/861.changed b/changes/861.changed new file mode 100644 index 000000000..5c505af53 --- /dev/null +++ b/changes/861.changed @@ -0,0 +1 @@ +- [chore] `towncrier` is now used for changelog management ([#861](https://github.com/Substra/substra-backend/pull/861)) diff --git a/pyproject.toml b/pyproject.toml index 04dd6317b..56b1b6335 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,3 +96,15 @@ exclude = [ [tool.django-stubs] django_settings_module = "backend.settings.test" + + +[tool.towncrier] +directory = "changes" +filename = "CHANGELOG.md" +start_string = "\n" +underlines = ["", "", ""] +title_format = "## [{version}](https://github.com/Substra/substra-backend/releases/tag/{version}) - {project_date}" +[tool.towncrier.fragment.added] +[tool.towncrier.fragment.removed] +[tool.towncrier.fragment.changed] +[tool.towncrier.fragment.fixed]