-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(changelog): make changelog.header a template (#697)
- Loading branch information
Showing
5 changed files
with
109 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[changelog] | ||
# changelog header | ||
header = """ | ||
# Changelog | ||
{% for release in releases %}\ | ||
{% if release.version %}\ | ||
{% if release.previous.version %}\ | ||
<!--{{ release.previous.version }}..{{ release.version }}--> | ||
{% endif %}\ | ||
{% else %}\ | ||
<!--{{ release.previous.version }}..HEAD--> | ||
{% endif %}\ | ||
{% endfor %}\ | ||
""" | ||
# template for the changelog body | ||
# https://keats.github.io/tera/docs/#introduction | ||
body = """ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}] | ||
{% else %}\ | ||
## [unreleased] | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | upper_first }} | ||
{% for commit in commits %} | ||
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
# remove the leading and trailing whitespace from the templates | ||
trim = true |
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,16 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
GIT_COMMITTER_DATE="2021-01-23 01:23:45" git commit --allow-empty -m "feat: add feature 1" | ||
GIT_COMMITTER_DATE="2021-01-23 01:23:45" git commit --allow-empty -m "feat: add feature 2" | ||
git tag v0.1.0 | ||
|
||
GIT_COMMITTER_DATE="2021-01-23 01:23:46" git commit --allow-empty -m "fix: fix feature 1" | ||
GIT_COMMITTER_DATE="2021-01-23 01:23:46" git commit --allow-empty -m "fix: fix feature 2" | ||
git tag v0.2.0 | ||
|
||
GIT_COMMITTER_DATE="2021-01-23 01:23:47" git commit --allow-empty -m "feat: add footer" | ||
git tag v3.0.0 | ||
|
||
GIT_COMMITTER_DATE="2021-01-23 01:23:47" git commit --allow-empty -m "test: footer" | ||
GIT_COMMITTER_DATE="2021-01-23 01:23:47" git commit --allow-empty -m "perf: footer" |
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,33 @@ | ||
# Changelog | ||
<!--v3.0.0..HEAD--> | ||
<!--v0.2.0..v3.0.0--> | ||
<!--v0.1.0..v0.2.0--> | ||
## [unreleased] | ||
|
||
### Perf | ||
|
||
- Footer | ||
|
||
### Test | ||
|
||
- Footer | ||
|
||
## [3.0.0] | ||
|
||
### Feat | ||
|
||
- Add footer | ||
|
||
## [0.2.0] | ||
|
||
### Fix | ||
|
||
- Fix feature 1 | ||
- Fix feature 2 | ||
|
||
## [0.1.0] | ||
|
||
### Feat | ||
|
||
- Add feature 1 | ||
- Add feature 2 |
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