-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add CHANGELOG.md scripts (#26)
Since apparently we never bothered to update this.
- Loading branch information
Showing
3 changed files
with
139 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Configuration file for [`git-cliff`](https://github.com/orhun/git-cliff) | ||
# See https://git-cliff.org/docs/configuration | ||
|
||
[changelog] | ||
header = """ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n | ||
""" | ||
# https://tera.netlify.app/docs/#introduction | ||
body = """ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}](https://github.com/foundry-rs/compilers/releases/tag/v{{ version | trim_start_matches(pat="v") }}) - {{ timestamp | date(format="%Y-%m-%d") }} | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | title }} | ||
{% for commit in commits %} | ||
- {% if commit.scope %}[{{ commit.scope }}] {% endif %}{{ commit.message | upper_first | split(pat="\\n") | first }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
trim = true | ||
footer = "<!-- generated by git-cliff -->" | ||
|
||
[git] | ||
conventional_commits = true | ||
filter_unconventional = false | ||
commit_preprocessors = [ | ||
{ pattern = '#(\d+)', replace = "[#$1](https://github.com/foundry-rs/compilers/issues/$1)" }, | ||
] | ||
commit_parsers = [ | ||
{ message = "^feat", group = "Features" }, | ||
{ message = "^fix", group = "Bug Fixes" }, | ||
{ message = "^doc", group = "Documentation" }, | ||
{ message = ".*\\b([Dd]eps|[Dd]ependencies|[Bb]ump)\\b", group = "Dependencies" }, | ||
{ message = "^perf", group = "Performance" }, | ||
{ message = "^refactor", group = "Refactor" }, | ||
{ message = ".*\\b(style|fmt|format)\\b", group = "Styling" }, | ||
{ message = "^test", group = "Testing" }, | ||
{ message = "^chore", group = "Miscellaneous Tasks" }, | ||
|
||
{ message = ".*", group = "Other" }, | ||
] | ||
protect_breaking_commits = false | ||
filter_commits = false | ||
tag_pattern = "v[0-9]*" | ||
skip_tags = "beta|alpha" | ||
ignore_tags = "rc" | ||
sort_commits = "newest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
set -e -o pipefail | ||
|
||
root=$(dirname "$(dirname "$0")") | ||
cmd=(git cliff --workdir "$root" --output "$root/CHANGELOG.md" "$@") | ||
|
||
if [ "$DRY_RUN" = "true" ]; then | ||
echo "skipping due to dry run: ${cmd[*]}" >&2 | ||
exit 0 | ||
else | ||
"${cmd[@]}" | ||
fi |