Skip to content

Commit 5f1f96a

Browse files
authored
fix(ci): Re-add git cliff output to release notes (#55)
1 parent 426dba6 commit 5f1f96a

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

.github/workflows/CI.yml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -485,31 +485,22 @@ jobs:
485485
with:
486486
fetch-depth: 0 # get all tags
487487

488-
- name: Get release notes
489-
id: get_release_notes
490-
run: |
491-
# Get the latest tag
492-
latest_tag=$(git describe --tags --abbrev=0)
493-
echo "latest_tag=${latest_tag}" >> $GITHUB_ENV
494-
495-
# Extract release notes from CHANGELOG.md
496-
# This script extracts the content between the latest tag and the previous tag.
497-
notes=$(awk -v tag="## [${latest_tag##v}]" '
498-
BEGIN { p = 0 }
499-
index($0, tag) { p = 1; next }
500-
p && /^## / { exit }
501-
p { print }
502-
' CHANGELOG.md)
503-
echo "notes<<EOF" >> $GITHUB_OUTPUT
504-
echo "$notes" >> $GITHUB_OUTPUT
505-
echo "EOF" >> $GITHUB_OUTPUT
488+
- name: Generate a changelog
489+
uses: orhun/git-cliff-action@v4
490+
id: git-cliff
491+
with:
492+
config: cliff.toml
493+
args: -vv --latest --strip header
494+
env:
495+
OUTPUT: CHANGELOG.md
496+
GITHUB_REPO: ${{ github.repository }}
506497

507498
- name: Create Release
508499
uses: softprops/action-gh-release@v2
509500
with:
510-
tag_name: ${{ env.latest_tag }}
511-
name: "Release ${{ env.latest_tag }}"
512-
body: ${{ steps.get_release_notes.outputs.notes }}
501+
tag_name: ${{ github.ref_name }}
502+
name: "Release ${{ github.ref_name }}"
503+
body: ${{ steps.git-cliff.outputs.content }}
513504
draft: false
514505
prerelease: contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')
515506
env:

cliff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body = """
2020
{%- set commit_message = commit.message -%}
2121
{%- endif -%}
2222
* {{ commit_message | split(pat="\n") | first | trim }}\
23-
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
23+
{% if commit.remote.username %} by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }}){%- endif -%}
2424
{% if commit.remote.pr_number %} in \
2525
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
2626
{%- endif %}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ classifiers = [
2121
"Programming Language :: Python :: 3.11",
2222
"Programming Language :: Python :: 3.12",
2323
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
2425
"License :: OSI Approved :: MIT License",
2526
"Operating System :: POSIX",
2627
"Operating System :: MacOS :: MacOS X",

0 commit comments

Comments
 (0)