Skip to content

Commit 6a7eebd

Browse files
committed
Add git cliff config
When I started maturin, I chose the https://keepachangelog.com style for the project changelog, and would edit the changelog manually. I now want to change this to automated changelog generation and a slightly improved style. This PR adds a [git cliff](https://git-cliff.org/) config that can generate the changelog based on commits and PR labels. The style is simplified, The version header doesn't have a link anymore, and the PR link is in parentheses behind the description. It also adds a release guide to the contributing guidelines, with the goal of simplifying the release workflow. Blocked on orhun/git-cliff#1189
1 parent 46dbaff commit 6a7eebd

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

cliff.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[changelog]
2+
header = """
3+
# Changelog
4+
5+
"""
6+
body = """
7+
{% if version %}\
8+
## [{{ version | trim_start_matches(pat="v") }}]
9+
{% else %}\
10+
## [unreleased]
11+
{% endif %}\
12+
{% for commit in commits %}
13+
- {% if commit.remote.pr_title %}\
14+
{{ commit.remote.pr_title | upper_first }}\
15+
{% else %}\
16+
{{ commit.message | split(pat="\n") | first | upper_first }}\
17+
{% endif %}\
18+
{% if commit.remote.pr_number %} ([#{{ commit.remote.pr_number }}](https://github.com/pyo3/maturin/pull/{{ commit.remote.pr_number }})){%- endif %}\
19+
{% endfor %}\n
20+
"""
21+
22+
[git]
23+
conventional_commits = false
24+
filter_unconventional = false
25+
commit_parsers = [
26+
{ field = "github.pr_labels", pattern = "internal", skip = true },
27+
{ message = ".*pre-commit autoupdate.*", skip = true },
28+
{ message = ".*", group = "Other" },
29+
]
30+
31+
[remote.github]
32+
owner = "pyo3"
33+
repo = "maturin"

guide/src/contributing.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,23 @@ There are some optional hacks that can speed up the tests (over 80s to 17s on my
100100
1. By running `cargo build --release --manifest-path test-crates/cargo-mock/Cargo.toml` you can activate a cargo cache avoiding to rebuild the pyo3 test crates with every python version.
101101
2. Delete `target/test-cache` to clear the cache (e.g. after changing a test crate) or remove `test-crates/cargo-mock/target/release/cargo` to deactivate it.
102102
3. By running the tests with the `faster-tests` feature, binaries are stripped and wheels are only stored and not compressed.
103+
104+
## Releasing
105+
106+
_These instructions are a work in progress_
107+
108+
Update the changelog:
109+
110+
```
111+
git cliff -u --prepend Changelog.md
112+
```
113+
114+
Update the version in `Cargo.toml` and run:
115+
116+
```
117+
cargo check
118+
```
119+
120+
Create a PR a release PR.
121+
122+
After the release PR merged, update main, create a git tag and push the tag.

0 commit comments

Comments
 (0)