From f7a657ac46259713cd25a4a0dda6e7b7b9498201 Mon Sep 17 00:00:00 2001 From: leeguooooo Date: Mon, 15 Jun 2026 12:17:38 +0900 Subject: [PATCH] =?UTF-8?q?ci(release):=20group=20changelog=20by=20type=20?= =?UTF-8?q?(=E2=9C=A8=20Features=20/=20=F0=9F=90=9B=20Fixes=20/=20?= =?UTF-8?q?=F0=9F=94=A7=20Other)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release notes were a flat list of commit subjects — hard to tell at a glance what was added vs fixed (recurring '看不出改了什么'). Group by conventional-commit type so every future release auto-shows scannable Features/Fixes sections. --- .github/workflows/release-binaries.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 4ef6cd4..2530741 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -147,16 +147,24 @@ jobs: git fetch --tags --force --quiet origin 2>/dev/null || true TAG="${{ github.event.inputs.tag || github.ref_name }}" PREV="$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null || true)" + RANGE="${TAG}" + [ -n "$PREV" ] && RANGE="${PREV}..${TAG}" + # Group commit subjects by conventional-commit type so the notes are + # scannable ("what's new / what's fixed") instead of a flat dev log. + LOG="$(git log "$RANGE" --no-merges --pretty='%s' | grep -v '^chore(release)' || true)" + section() { # $1=header $2=grep-pattern + local body; body="$(printf '%s\n' "$LOG" | grep -E "$2" | sed 's/^/- /')" + [ -n "$body" ] && { printf '\n### %s\n%s\n' "$1" "$body"; } + } { echo "notes<<__NOTES_EOF__" echo "## What changed" - echo "" + section "✨ Features" '^feat' + section "🐛 Fixes" '^fix' + section "🔧 Other" '^(perf|refactor|docs|build|ci|test|style|revert)' if [ -n "$PREV" ]; then - git log "${PREV}..${TAG}" --no-merges --pretty='- %s' | grep -v '^- chore(release)' || true echo "" echo "**Full changelog**: https://github.com/${{ github.repository }}/compare/${PREV}...${TAG}" - else - git log "${TAG}" --no-merges --pretty='- %s' | grep -v '^- chore(release)' || true fi echo "__NOTES_EOF__" } >> "$GITHUB_OUTPUT"