Skip to content

Commit 7f05134

Browse files
committed
ci: generate changelog
1 parent a924d2d commit 7f05134

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

β€Žcliff.tomlβ€Ž

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# https://git-cliff.org/docs/configuration
2+
[changelog]
3+
header = ""
4+
# template for the changelog body
5+
# https://keats.github.io/tera/docs/#introduction
6+
body = """
7+
{% if version %}\
8+
{% if previous.version %}\
9+
## [{{ version | trim_start_matches(pat="v") }}]\
10+
({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
11+
{% else %}\
12+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
13+
{% endif %}\
14+
{% else %}\
15+
## [unreleased]
16+
{% endif %}\
17+
18+
{% for group, commits in commits | group_by(attribute="group") %}
19+
### {{ group | striptags | trim | upper_first }}
20+
{% for commit in commits
21+
| filter(attribute="scope")
22+
| sort(attribute="scope") %}
23+
{{ self::print_commit(commit=commit) }}
24+
{%- endfor %}
25+
{% for commit in commits %}
26+
{%- if not commit.scope -%}
27+
{{ self::print_commit(commit=commit) }}
28+
{% endif -%}
29+
{% endfor -%}
30+
{% endfor -%}
31+
32+
### Install prebuilt binaries via shell script
33+
34+
```sh
35+
VERSION="{{ version }}" bash <(curl -sSL https://raw.githubusercontent.com/RustLangES/grhooks/main/scripts/install.sh)
36+
```
37+
38+
### Install prebuilt binaries via powershell script
39+
40+
```sh
41+
powershell -ExecutionPolicy Bypass -c "$env:VERSION='{{ version }}'; $ProgressPreference='SilentlyContinue'; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/RustLangES/grhooks/main/scripts/install.ps1'))"
42+
```
43+
44+
{%- if github -%}
45+
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
46+
## New Contributors ❀️
47+
{% endif %}\
48+
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
49+
* @{{ contributor.username }} made their first contribution
50+
{%- if contributor.pr_number %} in \
51+
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
52+
{%- endif %}
53+
{%- endfor -%}
54+
{%- endif %}
55+
"""
56+
footer = ""
57+
trim = true
58+
postprocessors = [
59+
{ pattern = '<REPO>', replace = "https://github.com/RustLangES/memsos" },
60+
]
61+
62+
[git]
63+
# parse the commits based on https://www.conventionalcommits.org
64+
conventional_commits = true
65+
# filter out the commits that are not conventional
66+
filter_unconventional = true
67+
split_commits = false
68+
# sort the commits inside sections by oldest/newest order
69+
sort_commits = "newest"
70+
commit_parsers = [
71+
{ message = "^feat", group = "<!-- 0 -->πŸš€ Features" },
72+
{ message = "^fix", group = "<!-- 1 -->πŸ› Bug Fixes" },
73+
{ message = "^doc", group = "<!-- 3 -->πŸ“š Documentation" },
74+
{ message = "^perf", group = "<!-- 4 -->⚑ Performance" },
75+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
76+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
77+
{ message = "^test", group = "<!-- 6 -->πŸ§ͺ Testing" },
78+
{ message = "^chore\\(release\\): prepare for", skip = true },
79+
{ message = "^chore\\(deps.*\\)", skip = true },
80+
{ message = "^chore\\(pr\\)", skip = true },
81+
{ message = "^chore\\(pull\\)", skip = true },
82+
{ message = "^chore|^ci", group = "<!-- 7 -->βš™οΈ Miscellaneous Tasks" },
83+
{ body = ".*security", group = "<!-- 8 -->πŸ›‘οΈ Security" },
84+
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
85+
]
86+
commit_preprocessors = [
87+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
88+
]
89+
# protect breaking changes from being skipped due to matching a skipping commit_parser
90+
protect_breaking_commits = false
91+
# filter out the commits that are not matched by commit parsers
92+
filter_commits = false

0 commit comments

Comments
Β (0)