Skip to content

Commit

Permalink
chore: Add templates for changelog and release notes
Browse files Browse the repository at this point in the history
Signed-off-by: Sietze van Buuren <s.van.buuren@gmail.com>
  • Loading branch information
swvanbuuren committed Nov 8, 2024
1 parent 680b5a7 commit 4494fb4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/templates/.release_notes.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{#
## vX.X.X (YYYY-MMM-DD)
#}{{

"## %s (%s)\n" | format(
release.version.as_semver_tag(),
release.tagged_date.strftime("%Y-%m-%d")
)

}}{% set commit_objects = release["elements"] | dictsort
%}{#
#}{% for type_, commits in commit_objects
%}{{
"\n### %s\n" | format(type_ | title)

}}{% for commit in commits
%}{{
"\n* %s ([`%s`](%s))\n" | format(
commit.descriptions[0].rstrip(),
commit.short_hash,
commit.hexsha | commit_hash_url,
)

}}{% endfor
%}{% endfor
%}
24 changes: 24 additions & 0 deletions .github/templates/CHANGELOG.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CHANGELOG

{% for version, release in ctx.history.released.items()
%}{{
"## %s (%s)\n" | format(version.as_tag(), release.tagged_date.strftime("%Y-%m-%d"))

}}{% set commit_objects = release["elements"] | dictsort
%}{#
#}{% for type_, commits in commit_objects if type_ != "unknown"
%}{{
"\n### %s\n" | format(type_ | title)

}}{% for commit in commits
%}{{
"\n* %s ([`%s`](%s))\n" | format(
commit.descriptions[0].rstrip(),
commit.short_hash,
commit.hexsha | commit_hash_url
)

}}{% endfor
%}{% endfor
%}{% endfor
%}
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ include = ["simple_cdd_yaml", "simple_cdd_yaml.*"]
[tool.semantic_release]
version_variables = ["simple_cdd_yaml/__init__.py:__version__"]
version_toml = ["pyproject.toml:project.version"]

[tool.semantic_release.changelog]
template_dir = ".github/templates"

0 comments on commit 4494fb4

Please sign in to comment.