From 3d27d44676597d53affd5dc58d5b43c7a13aad3b Mon Sep 17 00:00:00 2001 From: cexll Date: Tue, 16 Dec 2025 10:47:18 +0800 Subject: [PATCH] chore(ci): integrate git-cliff for automated changelog generation - Add cliff.toml configuration matching current CHANGELOG.md format - Replace awk script with npx git-cliff in release workflow - Add `make changelog` command for one-click CHANGELOG updates - Use git-cliff --current flag to generate release notes per version Generated with swe-agent-bot Co-Authored-By: swe-agent-bot --- .github/workflows/release.yml | 29 ++++++-------- CHANGELOG.md | 11 ++++++ Makefile | 17 ++++++++- cliff.toml | 72 +++++++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 19 deletions(-) create mode 100644 cliff.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f543d6..eaaa4f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -97,6 +97,11 @@ jobs: with: path: artifacts + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + - name: Prepare release files run: | mkdir -p release @@ -104,32 +109,20 @@ jobs: cp install.sh install.bat release/ ls -la release/ - - name: Extract release notes from CHANGELOG - id: extract_notes + - name: Generate release notes with git-cliff run: | - VERSION=${GITHUB_REF#refs/tags/v} + # Install git-cliff via npx + npx git-cliff@latest --current --strip all -o release_notes.md - # Extract version section from CHANGELOG.md - awk -v ver="$VERSION" ' - /^## [0-9]+\.[0-9]+\.[0-9]+ - / { - if (found) exit - if ($2 == ver) { - found = 1 - next - } - } - found && /^## / { exit } - found { print } - ' CHANGELOG.md > release_notes.md - - # Fallback to auto-generated if extraction failed + # Fallback if generation failed if [ ! -s release_notes.md ]; then - echo "โš ๏ธ No release notes found in CHANGELOG.md for version $VERSION" > release_notes.md + echo "โš ๏ธ Failed to generate release notes with git-cliff" > release_notes.md echo "" >> release_notes.md echo "## What's Changed" >> release_notes.md echo "See commits in this release for details." >> release_notes.md fi + echo "--- Generated Release Notes ---" cat release_notes.md - name: Create Release diff --git a/CHANGELOG.md b/CHANGELOG.md index 7798c8b..ea58735 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +## [5.2.4] - 2025-12-16 + +### ๐Ÿ› Bug Fixes + +- *(executor)* Isolate log files per task in parallel mode +- *(codeagent)* ้˜ฒๆญข Claude backend ๆ— ้™้€’ๅฝ’่ฐƒ็”จ + +### โš™๏ธ Miscellaneous Tasks + +- Bump version to 5.2.4 + ## [5.2.3] - 2025-12-15 ### ๐Ÿ› Bug Fixes diff --git a/Makefile b/Makefile index 9fc260e..557f4ac 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Claude Code Multi-Agent Workflow System Makefile # Quick deployment for BMAD and Requirements workflows -.PHONY: help install deploy-bmad deploy-requirements deploy-essentials deploy-advanced deploy-all deploy-commands deploy-agents clean test +.PHONY: help install deploy-bmad deploy-requirements deploy-essentials deploy-advanced deploy-all deploy-commands deploy-agents clean test changelog # Default target help: @@ -22,6 +22,7 @@ help: @echo " deploy-all - Deploy everything (commands + agents)" @echo " test-bmad - Test BMAD workflow with sample" @echo " test-requirements - Test Requirements workflow with sample" + @echo " changelog - Update CHANGELOG.md using git-cliff" @echo " clean - Clean generated artifacts" @echo " help - Show this help message" @@ -145,3 +146,17 @@ all: deploy-all version: @echo "Claude Code Multi-Agent Workflow System v3.1" @echo "BMAD + Requirements-Driven Development" + +# Update CHANGELOG.md using git-cliff +changelog: + @echo "๐Ÿ“ Updating CHANGELOG.md with git-cliff..." + @if ! command -v git-cliff > /dev/null 2>&1; then \ + echo "โŒ git-cliff not found. Installing via Homebrew..."; \ + brew install git-cliff; \ + fi + @git-cliff -o CHANGELOG.md + @echo "โœ… CHANGELOG.md updated successfully!" + @echo "" + @echo "Preview the changes:" + @echo " git diff CHANGELOG.md" + diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..186b251 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,72 @@ +# git-cliff configuration file +# https://git-cliff.org/docs/configuration + +[changelog] +# changelog header +header = """ +# Changelog + +All notable changes to this project will be documented in this file. +""" +# template for the changelog body +body = """ +{% if version %} +## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %} +## Unreleased +{% endif %} +{% for group, commits in commits | group_by(attribute="group") %} +### {{ group }} + +{% for commit in commits %} +- {{ commit.message | split(pat="\n") | first }} +{% endfor -%} +{% endfor -%} +""" +# remove the leading and trailing whitespace from the template +trim = true +# changelog footer +footer = """ + +""" + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = false +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/cexll/myclaude/issues/${2}))" }, +] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "๐Ÿš€ Features" }, + { message = "^fix", group = "๐Ÿ› Bug Fixes" }, + { message = "^doc", group = "๐Ÿ“š Documentation" }, + { message = "^perf", group = "โšก Performance" }, + { message = "^refactor", group = "๐Ÿšœ Refactor" }, + { message = "^style", group = "๐ŸŽจ Styling" }, + { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^chore\\(release\\):", skip = true }, + { message = "^chore", group = "โš™๏ธ Miscellaneous Tasks" }, + { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, + { message = "^revert", group = "โ—€๏ธ Revert" }, + { message = ".*", group = "๐Ÿ’ผ Other" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = false +# filter out the commits that are not matched by commit parsers +filter_commits = false +# glob pattern for matching git tags +tag_pattern = "v[0-9]*" +# regex for skipping tags +skip_tags = "v0.1.0-beta.1" +# regex for ignoring tags +ignore_tags = "" +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "newest"