Skip to content

Commit 5863c85

Browse files
fix: make git-cliff simplify version numbers
Previously, the `git-cliff` template we had configured would generate section headings based solely on the Git tags picked up for new versions, which were prefixed with the name of the crate being released by `cargo-release`. These headers looked like `gitoid-v0.5.1`, and unfortunately would _not_ be picked up by `cargo-dist` when generating GitHub releases. This commit modifies the template to put the headers in a simpler format that `cargo-dist` _should_ be able to discover. Signed-off-by: Andrew Lilley Brinker <alilleybrinker@gmail.com>
1 parent 3fbf58c commit 5863c85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8181

8282
body = """
8383
{% if version -%}
84-
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
84+
## [{{ version | split(pat="-") | last | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
8585
{% else -%}
8686
## [Unreleased]
8787
{% endif -%}
@@ -97,7 +97,7 @@ footer = """
9797
{% for release in releases -%}
9898
{% if release.version -%}
9999
{% if release.previous.version -%}
100-
[{{ release.version | trim_start_matches(pat="v") }}]: \
100+
[{{ release.version | split(pat="-") | last | trim_start_matches(pat="v") }}]: \
101101
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
102102
/compare/{{ release.previous.version }}..{{ release.version }}
103103
{% endif -%}

0 commit comments

Comments
 (0)