Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[changelog]
header = ""
body = """
## Changes
{% if commits | length == 0 %}
- No changes recorded.
{% else %}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim }}
{% for commit in commits %}
- {{ commit.message | upper_first | replace_regex(from=" \\(#\\d+\\)$", to="") }}{% if commit.author and commit.author.name %} by {{ commit.author.name }}{% endif %}{% if commit.remote and commit.remote.username %} (@{{ commit.remote.username }}){% endif %}{% if commit.remote and commit.remote.pr_number %} in [#{{ commit.remote.pr_number }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.remote.pr_number }}){% else %}{% set pr_matches = commit.raw_message | find_regex(pat="\\(#\\d+\\)") %}{% if pr_matches | length > 0 %}{% set pr_number = pr_matches | first | replace_regex(from="[^0-9]", to="") %} in [#{{ pr_number }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ pr_number }}){% else %} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/commit/{{ commit.id }})){% endif %}{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
"""
footer = ""
trim = true

[remote.github]
owner = "openecos-projects"
repo = "ecc-tools"

[git]
conventional_commits = true
filter_unconventional = false
split_commits = false
sort_commits = "oldest"
commit_preprocessors = [
{ pattern = "^fixup! ", replace = "" },
{ pattern = "\"+$", replace = "" },
]
commit_parsers = [
{ message = "^Merge ", skip = true },
{ message = "^feat", group = "<!-- 0 -->Features" },
{ message = "(?i)^(add|implement|enhance|init)\\b", group = "<!-- 0 -->Features" },
{ message = "^fix", group = "<!-- 1 -->Bug Fixes" },
{ message = "(?i)^fix bugs\\b", group = "<!-- 1 -->Bug Fixes" },
{ message = "(?i)^(correct|regenerate|do not|restore)\\b", group = "<!-- 1 -->Bug Fixes" },
{ message = "^docs", group = "<!-- 2 -->Documentation" },
{ message = "(?i)^update .*\\b(readme|guide|docs?|documentation|comment)\\b", group = "<!-- 2 -->Documentation" },
{ message = "^refactor", group = "<!-- 3 -->Refactors" },
{ message = "(?i)^(rename|move|iSTA:|liberty:)\\b", group = "<!-- 3 -->Refactors" },
{ message = "^perf", group = "<!-- 4 -->Performance" },
{ message = "^test", group = "<!-- 5 -->Tests" },
{ message = "^build", group = "<!-- 6 -->Build" },
{ message = "(?i)^nix:", group = "<!-- 6 -->Build" },
{ message = "^ci", group = "<!-- 7 -->CI" },
{ message = "^style", group = "<!-- 8 -->Style" },
{ message = "^chore", group = "<!-- 9 -->Chores" },
{ message = "(?i)^(update (harden flow|params|interface|ecc-tools|ignore|submodules?)\\b|wip:|cleanup\\b)", group = "<!-- 9 -->Chores" },
{ message = "^revert", group = "<!-- 10 -->Reverts" },
{ message = ".*", group = "<!-- 11 -->Other" },
]
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,21 @@ jobs:
echo "version=$TAG_VERSION" >> "$GITHUB_OUTPUT"
echo "full_tag=$FULL_TAG" >> "$GITHUB_OUTPUT"

- name: Generate changelog with git-cliff
uses: orhun/git-cliff-action@v4
with:
config: .github/cliff.toml
args: --latest --output release-changelog.md
github_token: ${{ github.token }}
env:
GITHUB_REPO: ${{ github.repository }}

- name: Generate release notes
id: notes
run: |
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
{
if [[ -n "$PREV_TAG" ]]; then
echo "## Changes"
echo ""
git log --oneline --no-merges "${PREV_TAG}..HEAD" | sed 's/^/- /'
echo ""
fi
cat release-changelog.md
echo ""
echo "## Checksums"
echo ""
echo '```'
Expand Down
Loading