diff --git a/pyproject.toml b/pyproject.toml index 78cb807..0c44f7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,3 +34,6 @@ include = ["mlpyqtgraph", "mlpyqtgraph.*"] [tool.semantic_release] version_variables = ["mlpyqtgraph/__init__.py:__version__"] version_toml = ["pyproject.toml:project.version"] + +[tool.semantic_release.changelog] +template_dir = "templates" diff --git a/templates/.release_notes.md.j2 b/templates/.release_notes.md.j2 new file mode 100644 index 0000000..84f9ef3 --- /dev/null +++ b/templates/.release_notes.md.j2 @@ -0,0 +1,29 @@ +{# + +## 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 by %s ([`%s`](%s))\n" | format( + commit.descriptions[0].rstrip(), + commit.author.name, + commit.short_hash, + commit.hexsha | commit_hash_url, + ) + +}}{% endfor +%}{% endfor +%} diff --git a/templates/CHANGELOG.md.j2 b/templates/CHANGELOG.md.j2 new file mode 100644 index 0000000..615c805 --- /dev/null +++ b/templates/CHANGELOG.md.j2 @@ -0,0 +1,23 @@ +# CHANGELOG + +{% for version, release in ctx.history.released.items() +%}{{ + "## %s (%s)" | format(version.as_tag(), release.tagged_date.strftime("%Y-%m-%d")) + +}}{% for type_, commits in release["elements"] if type_ != "unknown" | dictsort +%}{{ + "### %s" | format(type_ | title) + +}}{% for commit in commits +%}{{ + "\n* %s by %s ([`%s`](%s))\n" | format( + commit.descriptions[0].rstrip(), + commit.author.name, + commit.short_hash, + commit.hexsha | commit_hash_url, + ) + +}}{% endfor +%}{% endfor +%}{% endfor +%}