Skip to content

Commit e719e1c

Browse files
committed
v0.5.0
1 parent 8c3fddd commit e719e1c

File tree

4 files changed

+81
-3
lines changed

4 files changed

+81
-3
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ jobs:
3636
tar czf macmon-${{ github.ref_name }}.tar.gz readme.md LICENSE macmon
3737
ls -lah | grep macmon
3838
39+
- name: Generate a changelog
40+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
41+
id: git-cliff
42+
uses: orhun/git-cliff-action@v4
43+
with:
44+
args: --latest
45+
3946
- uses: softprops/action-gh-release@v2
4047
with:
48+
body: ${{ steps.git-cliff.outputs.changelog }}
4149
files: macmon-${{ github.ref_name }}.tar.gz
42-
generate_release_notes: true
4350
env:
4451
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4552

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "macmon"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
edition = "2021"
55

66
[lints.rust]

cliff.toml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# from: https://github.com/orhun/git-cliff/blob/main/cliff.toml
2+
3+
[changelog]
4+
trim = true
5+
postprocessors = [{ pattern = '<REPO>', replace = "https://github.com/vladkens/ghstats" }]
6+
body = """
7+
{%- macro remote_url() -%}
8+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
9+
{%- endmacro -%}
10+
11+
{% macro print_commit(commit) -%}
12+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
13+
{% if commit.breaking %}[**breaking**] {% endif %}\
14+
{{ commit.message | upper_first }} - \
15+
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
16+
{% endmacro -%}
17+
18+
{% if version %}\
19+
{% if previous.version %}\
20+
## [{{ version | trim_start_matches(pat="v") }}]\
21+
({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
22+
{% else %}\
23+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
24+
{% endif %}\
25+
{% else %}\
26+
## [unreleased]
27+
{% endif %}\
28+
29+
{% for group, commits in commits | group_by(attribute="group") %}
30+
### {{ group | striptags | trim | upper_first }}
31+
{% for commit in commits
32+
| filter(attribute="scope")
33+
| sort(attribute="scope") %}
34+
{{ self::print_commit(commit=commit) }}
35+
{%- endfor %}
36+
{% for commit in commits %}
37+
{%- if not commit.scope -%}
38+
{{ self::print_commit(commit=commit) }}
39+
{% endif -%}
40+
{% endfor -%}
41+
{% endfor -%}
42+
{%- if github -%}
43+
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
44+
## New Contributors ❤️
45+
{% endif %}\
46+
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
47+
* @{{ contributor.username }} made their first contribution
48+
{%- if contributor.pr_number %} in \
49+
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
50+
{%- endif %}
51+
{%- endfor -%}
52+
{%- endif %}
53+
"""
54+
55+
[git]
56+
conventional_commits = true
57+
filter_unconventional = true
58+
split_commits = false
59+
filter_commits = false
60+
tag_pattern = "v[0-9].*"
61+
topo_order = false
62+
sort_commits = "newest"
63+
commit_preprocessors = [
64+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
65+
]
66+
commit_parsers = [
67+
{ message = "^feat", group = "<!-- 0 --> Features" },
68+
{ message = "^fix", group = "<!-- 1 --> Bug Fixes" },
69+
{ message = "^chore", group = "<!-- 2 --> Other" },
70+
{ message = "^ci", skip = true },
71+
]

0 commit comments

Comments
 (0)