Skip to content

Commit 0cb13c1

Browse files
committed
ci: Add semantic release templates
Add templates for the release notes and `CHANGELOG` so `python-semantic-release` can generate these files correctly in CI.
1 parent 55a20c9 commit 0cb13c1

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

templates/.release_notes.md.j2

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% for type_, commits in release["elements"] | dictsort %}
2+
### {{ type_ | capitalize if type_ != "ci" else "Continuous Integration" }}
3+
{%- if type_ != "unknown" %}
4+
{% for commit in commits -%}
5+
{%- set summary = commit.message.rstrip().splitlines()[0] -%}
6+
{%- set details = commit.message.rstrip().splitlines()[2:] -%}
7+
* {{ summary }} ([`{{ commit.hexsha[:7] }}`]({{ commit.hexsha | commit_hash_url }}))
8+
{% if details %}
9+
{% for line in details %}{% if line.strip() %} {{ line }}{% endif %}
10+
{% endfor %}{% endif -%}
11+
{% endfor %}{% endif %}{% endfor %}

templates/CHANGELOG.md.j2

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# CHANGELOG
2+
3+
4+
{% for version, release in context.history.released.items() %}
5+
## {{ version.as_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }})
6+
{% for type_, commits in release["elements"] | dictsort %}
7+
### {{ type_ | capitalize if type_ != "ci" else "Continuous Integration" }}
8+
{% for commit in commits -%}
9+
{%- set summary = commit.message.rstrip().splitlines()[0] -%}
10+
{%- set details = commit.message.rstrip().splitlines()[2:] -%}
11+
* {{ summary }} ([`{{ commit.hexsha[:7] }}`]({{ commit.hexsha | commit_hash_url }}))
12+
{% if details %}
13+
{% for line in details %}{% if line.strip() %} {{ line }}{% endif %}
14+
{% endfor %}{% endif -%}
15+
{% endfor %}{% endfor %}{% endfor %}

0 commit comments

Comments
 (0)