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
18 changes: 12 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ jobs:
run: |
pip install git-cliff

- name: Get new version
- name: Get version numbers
id: get_version
run: |
current_version=$(gh release view --json tagName --jq '.tagName' || echo "v0.0.0")
echo "current_version=$current_version" >> $GITHUB_OUTPUT

new_version=$(git-cliff --bumped-version)
echo "new_version=$new_version" >> $GITHUB_OUTPUT

Expand All @@ -157,26 +160,29 @@ jobs:
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
changelog=$(git cliff --unreleased --bump --latest --strip all)
# strip off first line (which is the version number)
changelog=$(git-cliff --unreleased --bump --latest --strip all)
# Strip off first line (which is the version number)
changelog=$(printf "%s" "$changelog" | sed '1d')

# Get custom notes from the PR body
custom_notes="$PR_BODY"
# Fix line endings
custom_notes=$(printf "%s" "$custom_notes" | tr -d '\r')
custom_notes=$(echo "$custom_notes" | tr -d '\r')
# Keep only the part after the first '---' line
custom_notes=$(echo "$custom_notes" | sed -n '/^---$/,$p' | sed '1d')
# Strip leading / trailing whitespace
custom_notes=$(printf "%s" "$custom_notes" | sed 's/^[ \t]*//;s/[ \t]*$//')
custom_notes=$(echo "$custom_notes" | sed 's/^[ \t]*//;s/[ \t]*$//')

# Create the release notes file
touch /tmp/notes.md
echo "# Release ${{ steps.get_version.outputs.new_version }}" > /tmp/notes.md
if [[ -n "$custom_notes" ]]; then
printf "%s\n\n" "$custom_notes" >> /tmp/notes.md
fi
printf "## Changes\n%s\n" "$changelog" >> /tmp/notes.md
printf "## What's Changed\n%s\n" "$changelog" >> /tmp/notes.md

# Append link to full diff
echo -e "\n**Full diff**: https://github.com/${{ github.repository_owner }}/${{ github.repository }}/compare/${{ steps.get_version.outputs.current_version }}...${{ steps.get_version.outputs.new_version }}" >> /tmp/notes.md

echo "release_note_file=/tmp/notes.md" >> $GITHUB_OUTPUT

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

## [0.9.1] - 2025-06-04
## [0.9.1] - 2025-06-05

### Features

Expand Down