Skip to content

Commit

Permalink
ci: update config for python_semantic_release
Browse files Browse the repository at this point in the history
  • Loading branch information
HADB committed Jul 22, 2024
1 parent dc397c6 commit 06bcb37
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 38 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ prerelease = false
[tool.semantic_release.changelog]
template_dir = "templates"
changelog_file = "CHANGELOG.md"
exclude_commit_patterns = ["^build: *", "^chore: *", "^ci: *", "^test: *"]
exclude_commit_patterns = ["^build: *", "^chore: *", "^test: *"]

[tool.semantic_release.changelog.environment]
block_start_string = "{%"
Expand Down Expand Up @@ -55,7 +55,7 @@ allowed_tags = [
"test",
]
minor_tags = ["feat"]
patch_tags = ["fix", "perf", "refactor"]
patch_tags = ["fix", "perf", "refactor", "docs", "ci"]
default_bump_level = 0

[tool.semantic_release.remote]
Expand Down
17 changes: 0 additions & 17 deletions templates/.macros.j2

This file was deleted.

16 changes: 0 additions & 16 deletions templates/.release_notes.md.j2
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
{#
This is a Jinja template for generating release notes with Python Semantic Release.
Ref: https://python-semantic-release.readthedocs.io/en/latest/changelog_templates.html
#}

## What's Changed
{% for type_, commits in release["elements"] | dictsort %}
### {{ type_ | capitalize }}
{%- if type_ != "unknown" %}
{% for commit in commits %}
* {{ commit.descriptions[0] }} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }}))
{%- endfor %}{% endif %}{% endfor %}

{% from ".macros.j2" import version_compare_url %}
{% from ".macros.j2" import changelog_file_url %}

{% set releases = context.history.released.items() | list %}
{% set prev_version = releases[1][0] %}
{% set full_changelog_url = version_compare_url(prev_version, version) %}

**Full changes**: {{ full_changelog_url }}

**All changelog**: [CHANGELOG.md]({{ changelog_file_url() }})
6 changes: 3 additions & 3 deletions templates/CHANGELOG.md.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CHANGELOG
{% if context.history.unreleased | length > 0 %}
{% if context.history.unreleased | length > 0 -%}
{# UNRELEASED #}
## Unreleased
{% for type_, commits in context.history.unreleased | dictsort %}
Expand All @@ -8,8 +8,8 @@
* {{ commit.message.rstrip() }} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }}))
{% else %}
* {{ commit.message.rstrip() }} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }}))
{% endif %}{% endfor %}{% endfor %}{% endif %}
{% for version, release in context.history.released.items() %}
{% endif %}{% endfor %}{% endfor %}{% endif -%}
{% for version, release in context.history.released.items() -%}
{# RELEASED #}
## {{ version.as_semver_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }})
{% for type_, commits in release["elements"] | dictsort %}
Expand Down

0 comments on commit 06bcb37

Please sign in to comment.