Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,31 +485,22 @@ jobs:
with:
fetch-depth: 0 # get all tags

- name: Get release notes
id: get_release_notes
run: |
# Get the latest tag
latest_tag=$(git describe --tags --abbrev=0)
echo "latest_tag=${latest_tag}" >> $GITHUB_ENV

# Extract release notes from CHANGELOG.md
# This script extracts the content between the latest tag and the previous tag.
notes=$(awk -v tag="## [${latest_tag##v}]" '
BEGIN { p = 0 }
index($0, tag) { p = 1; next }
p && /^## / { exit }
p { print }
' CHANGELOG.md)
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$notes" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Generate a changelog
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.latest_tag }}
name: "Release ${{ env.latest_tag }}"
body: ${{ steps.get_release_notes.outputs.notes }}
tag_name: ${{ github.ref_name }}
name: "Release ${{ github.ref_name }}"
body: ${{ steps.git-cliff.outputs.content }}
draft: false
prerelease: contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')
env:
Expand Down
2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body = """
{%- set commit_message = commit.message -%}
{%- endif -%}
* {{ commit_message | split(pat="\n") | first | trim }}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
{% if commit.remote.username %} by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }}){%- endif -%}
{% if commit.remote.pr_number %} in \
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
{%- endif %}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
Expand Down