Skip to content

Commit

Permalink
chore: add towncrier for changelog management (#319)
Browse files Browse the repository at this point in the history
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
  • Loading branch information
SdgJlbl committed Mar 22, 2024
1 parent 04611cc commit de3e102
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
<!-- towncrier release notes start -->

## [0.48.0] - 2024-03-07

Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
`<unique_id>.<change_type>`.
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=<x.y.z>
```

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
Expand Down
1 change: 1 addition & 0 deletions changes/319.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [chore] `towncrier` is now used for changelog management ([#319](https://github.com/Substra/substra-frontend/pull/319))
10 changes: 10 additions & 0 deletions towncrier.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tool.towncrier]
directory = "changes"
filename = "CHANGELOG.md"
start_string = "<!-- towncrier release notes start -->\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]

0 comments on commit de3e102

Please sign in to comment.