Skip to content

Commit db2dfa0

Browse files
StarefossenCopilot
andcommitted
feat: auto-generate release notes with git-cliff
Replace manual CHANGELOG.md and GitHub's generate_release_notes with git-cliff, which parses conventional commit messages into grouped, human-readable release notes. - Add cliff.toml with commit grouping and date-based tag pattern - Update release workflow: checkout with full history, run git-cliff with --unreleased, feed output as release body - Replace CHANGELOG.md contents with convention docs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6f90ab5 commit db2dfa0

3 files changed

Lines changed: 62 additions & 24 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ jobs:
105105
permissions:
106106
contents: write
107107
steps:
108+
- uses: actions/checkout@v6
109+
with:
110+
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
111+
fetch-depth: 0
112+
108113
- uses: actions/download-artifact@v8
109114
with:
110115
path: artifacts
@@ -125,13 +130,20 @@ jobs:
125130
echo "title=cnctl ${DATE} (${SHORT_SHA})" >> "$GITHUB_OUTPUT"
126131
echo "sha=${COMMIT_SHA}" >> "$GITHUB_OUTPUT"
127132
133+
- name: Generate release notes
134+
id: changelog
135+
uses: orhun/git-cliff-action@v4
136+
with:
137+
config: cliff.toml
138+
args: --unreleased --tag ${{ steps.version.outputs.tag }}
139+
128140
- name: Create release
129141
uses: softprops/action-gh-release@v2
130142
with:
131143
tag_name: ${{ steps.version.outputs.tag }}
132144
target_commitish: ${{ steps.version.outputs.sha }}
133145
name: ${{ steps.version.outputs.title }}
134-
generate_release_notes: true
146+
body: ${{ steps.changelog.outputs.content }}
135147
make_latest: true
136148
files: |
137149
artifacts/cnctl-*

CHANGELOG.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file.
3+
Release notes are auto-generated from conventional commit messages using
4+
[git-cliff](https://git-cliff.org/). See the
5+
[GitHub Releases](https://github.com/CloudNativeBergen/website/releases) page
6+
for the full history.
47

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/),
6-
and this project adheres to [Semantic Versioning](https://semver.org/).
8+
## Configuration
79

8-
## [Unreleased]
10+
Commit message conventions:
911

10-
### Added
12+
- `feat:` / `feat(scope):` — new features
13+
- `fix:` — bug fixes
14+
- `perf:` — performance improvements
15+
- `refactor:` — code refactoring
16+
- `docs:` — documentation changes
1117

12-
- `cnctl admin sponsors email <id>` — send templated emails to sponsors
13-
- Interactive fuzzy-search template picker, pre-sorted by relevance
14-
- `--template <slug>` for non-interactive template selection
15-
- `--message` for direct message (skip templates)
16-
- `--edit` to open `$EDITOR` before sending
17-
- `--dry-run` to preview without sending
18-
- `--json` for machine-readable output
19-
- Automatic variable substitution (`{{{SPONSOR_NAME}}}`, etc.)
20-
- Template variable engine (`template.rs`) with unresolved variable detection
21-
- Browser-based OAuth login (GitHub / LinkedIn) with conference selection
22-
- `cnctl login` / `cnctl logout` / `cnctl status` commands
23-
- `cnctl admin proposals list` — list all talk proposals
24-
- `cnctl admin proposals get <id>` — show proposal details with speakers, topics, and reviews
25-
- `cnctl admin sponsors list` — list sponsor pipeline with status and tier
26-
- `cnctl admin sponsors get <id>` — show sponsor details with contacts, billing, and notes
27-
- Colored terminal output for status fields
28-
- CI workflow (clippy, fmt, test) across Linux, macOS, and Windows
29-
- Release workflow with cross-compilation for 5 targets
18+
Commits prefixed with `chore:`, `style:`, `ci:`, `test:`, or `build(deps):`
19+
are excluded from release notes.

cliff.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# git-cliff configuration for cnctl release notes
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
header = ""
6+
body = """
7+
{%- for group, commits in commits | group_by(attribute="group") %}
8+
### {{ group | upper_first }}
9+
{%- for commit in commits %}
10+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}{{ commit.message | upper_first }}\
11+
{%- endfor %}
12+
{% endfor %}
13+
"""
14+
footer = ""
15+
trim = true
16+
17+
[git]
18+
conventional_commits = true
19+
filter_unconventional = true
20+
split_commits = false
21+
commit_parsers = [
22+
{ message = "^feat", group = "Features" },
23+
{ message = "^fix", group = "Bug Fixes" },
24+
{ message = "^perf", group = "Performance" },
25+
{ message = "^refactor", group = "Refactor" },
26+
{ message = "^doc", group = "Documentation" },
27+
{ message = "^test", skip = true },
28+
{ message = "^style", skip = true },
29+
{ message = "^chore", skip = true },
30+
{ message = "^build\\(deps\\)", skip = true },
31+
{ message = "^build", group = "Build" },
32+
{ message = "^ci", skip = true },
33+
]
34+
filter_commits = false
35+
tag_pattern = "^\\d{4}\\.\\d{2}\\.\\d{2}-[0-9a-f]{7}$"
36+
sort_commits = "oldest"

0 commit comments

Comments
 (0)