-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: semi automatic changelog (#108)
- Loading branch information
Showing
16 changed files
with
246 additions
and
53 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
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,63 @@ | ||
# Configuration file for [`git-cliff`](https://github.com/orhun/git-cliff) | ||
# See https://git-cliff.org/docs/configuration | ||
|
||
[remote.github] | ||
owner = "paradigmxyz" | ||
repo = "solar" | ||
|
||
[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://keats.github.io/tera/docs/#introduction | ||
body = """\ | ||
{% set gh_link = "https://github.com/" ~ remote.github.owner ~ "/" ~ remote.github.repo %}\ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}]({{ gh_link }}/releases/tag/v{{ version | trim_start_matches(pat="v") }}) | ||
{% elif previous %}\ | ||
## [Unreleased]({{ gh_link }}/compare/{{ previous.version }}...HEAD) | ||
{% else %}\ | ||
## Unreleased | ||
{% 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/paradigmxyz/solar/issues/$1)" }, | ||
] | ||
commit_parsers = [ | ||
{ message = "^[Ff]eat", group = "Features" }, | ||
{ message = "^[Ff]ix", group = "Bug Fixes" }, | ||
{ message = "^[Dd]oc", group = "Documentation" }, | ||
{ message = ".*\\b([Dd]eps|[Dd]ependencies|[Bb]ump)\\b", group = "Dependencies" }, | ||
{ message = "^[Pp]erf", group = "Performance" }, | ||
{ message = "^[Rr]efactor", group = "Refactor" }, | ||
{ message = ".*\\b([Ss]tyle|[Ff]mt|[Ff]ormat)\\b", group = "Styling" }, | ||
{ message = "^[Tt]est", group = "Testing" }, | ||
{ message = "^[Cc]hore", group = "Miscellaneous Tasks" }, | ||
|
||
{ message = ".*", group = "Other" }, | ||
] | ||
protect_breaking_commits = false | ||
filter_commits = false | ||
tag_pattern = "v[0-9]*" | ||
skip_tags = "v?0\\.1\\.0" | ||
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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 @@ | ||
# 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). | ||
|
||
## [0.1.0](https://github.com/paradigmxyz/solar/releases/tag/v0.1.0) | ||
|
||
Initial release. | ||
|
||
<!-- generated by git-cliff --> |
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
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,24 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
|
||
run_unless_dry_run() { | ||
if [ "$DRY_RUN" = "true" ]; then | ||
echo "skipping due to dry run: $*" >&2 | ||
else | ||
"$@" | ||
fi | ||
} | ||
|
||
root=$WORKSPACE_ROOT | ||
crate=$CRATE_ROOT | ||
crate_glob="${crate#"$root/"}/**" | ||
|
||
if [[ "$CRATE_ROOT" != *crates/* ]]; then | ||
exit 0 | ||
fi | ||
|
||
command=(git cliff --workdir "$root" --config "$root/cliff.toml" --latest "${@}") | ||
run_unless_dry_run "${command[@]}" --prepend "$root/CHANGELOG.md" | ||
if [ -n "$crate" ] && [ "$root" != "$crate" ]; then | ||
run_unless_dry_run "${command[@]}" --include-path "$crate_glob" --prepend "$crate/CHANGELOG.md" | ||
fi |