Skip to content

Commit

Permalink
v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vladkens committed Dec 20, 2024
1 parent 8c3fddd commit e719e1c
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@ jobs:
tar czf macmon-${{ github.ref_name }}.tar.gz readme.md LICENSE macmon
ls -lah | grep macmon
- name: Generate a changelog
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
id: git-cliff
uses: orhun/git-cliff-action@v4
with:
args: --latest

- uses: softprops/action-gh-release@v2
with:
body: ${{ steps.git-cliff.outputs.changelog }}
files: macmon-${{ github.ref_name }}.tar.gz
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "macmon"
version = "0.4.2"
version = "0.5.0"
edition = "2021"

[lints.rust]
Expand Down
71 changes: 71 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# from: https://github.com/orhun/git-cliff/blob/main/cliff.toml

[changelog]
trim = true
postprocessors = [{ pattern = '<REPO>', replace = "https://github.com/vladkens/ghstats" }]
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% macro print_commit(commit) -%}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }} - \
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
{% endmacro -%}
{% if version %}\
{% if previous.version %}\
## [{{ version | trim_start_matches(pat="v") }}]\
({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% endif %}\
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits
| filter(attribute="scope")
| sort(attribute="scope") %}
{{ self::print_commit(commit=commit) }}
{%- endfor %}
{% for commit in commits %}
{%- if not commit.scope -%}
{{ self::print_commit(commit=commit) }}
{% endif -%}
{% endfor -%}
{% endfor -%}
{%- if github -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
## New Contributors ❤️
{% endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- endif %}
"""

[git]
conventional_commits = true
filter_unconventional = true
split_commits = false
filter_commits = false
tag_pattern = "v[0-9].*"
topo_order = false
sort_commits = "newest"
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
]
commit_parsers = [
{ message = "^feat", group = "<!-- 0 --> Features" },
{ message = "^fix", group = "<!-- 1 --> Bug Fixes" },
{ message = "^chore", group = "<!-- 2 --> Other" },
{ message = "^ci", skip = true },
]

0 comments on commit e719e1c

Please sign in to comment.