BlueGit

ict rusty-teams

ci(release): release notes from git-cliff with highlights, conventional PR titles

- cliff.toml groups feat, fix and packaging commits by scope, with PR links and contributors; direct pushes to main show up too
- Highlights come from the body of the chore(release) commit, the full list folds under "All changes"
- Notes never block publishing: a failed git-cliff run falls back to a short text
- New PR title check: type(scope): message, lowercase scope, no emoji
- CONTRIBUTING explains that the PR title becomes the release note line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-11-24 · 7 days ago

Hash
414be8e2046df79b7b42cd49ae0bb555f8a1ca18
Parent
06083c06
4 files changed +115 −2
.github/workflows/build.yml +37 −1
@@ -220,10 +220,46 @@ jobs:
220 220 permissions:
221 221 contents: write
222 222 steps:
223 # Full history and tags for the release notes.
224 - uses: actions/checkout@v6
225 with:
226 fetch-depth: 0
227
223 228 - uses: actions/download-artifact@v8
224 229 with:
225 230 path: dist
226 231
232 # Highlights from the body of the chore(release) commit, then git-cliff's list
233 # of every feat and fix since the previous release (cliff.toml).
234 - name: Release notes
235 env:
236 TAG: ${{ github.ref_name }}
237 GITHUB_TOKEN: ${{ github.token }}
238 GIT_CLIFF_VERSION: 2.14.2
239 GIT_CLIFF_SHA256: 24f397c733add5390fdceee3a2088588ab0d5f944ce00d34cb7029b888cf2db4
240 run: |
241 set -euo pipefail
242 archive="git-cliff-$GIT_CLIFF_VERSION-x86_64-unknown-linux-gnu.tar.gz"
243 curl -fsSL -o "$RUNNER_TEMP/$archive" \
244 "https://github.com/orhun/git-cliff/releases/download/v$GIT_CLIFF_VERSION/$archive" &&
245 echo "$GIT_CLIFF_SHA256 $RUNNER_TEMP/$archive" | sha256sum -c - &&
246 tar -xzf "$RUNNER_TEMP/$archive" -C "$RUNNER_TEMP" || true
247 cliff="$RUNNER_TEMP/git-cliff-$GIT_CLIFF_VERSION/git-cliff"
248 highlights="$(git log -1 --format=%b "$TAG" | grep -v -e '^Co-Authored-By:' -e 'Workspace version' | sed '/./,$!d' || true)"
249 # Notes must never block publishing the assets.
250 if ! {
251 if [[ -n "${highlights//[[:space:]]/}" ]]; then
252 printf '## Highlights\n\n%s\n\n<details>\n<summary>All changes</summary>\n\n' "$highlights"
253 "$cliff" --config cliff.toml --current --strip all
254 printf '\n</details>\n'
255 else
256 "$cliff" --config cliff.toml --current --strip all
257 fi
258 } > "$RUNNER_TEMP/notes.md"; then
259 echo "Release notes could not be generated, see the commits since the previous tag." > "$RUNNER_TEMP/notes.md"
260 fi
261 cat "$RUNNER_TEMP/notes.md"
262
227 263 # Artifacts drop the executable bit, the tarball restores it.
228 264 # Asset names use the version without the leading v (rusty-teams-0.5.0-…).
229 265 - name: Package
@@ -293,7 +329,7 @@ jobs:
293 329 if: steps.package.outputs.publish == 'true'
294 330 with:
295 331 files: release/*
296 generate_release_notes: true
332 body_path: ${{ runner.temp }}/notes.md
297 333 prerelease: ${{ contains(github.ref_name, '-') }}
298 334
299 335 - name: Fail when an asset is missing
@@ -220,10 +220,46 @@ jobs:
220 permissions:
220 permissions:
221 contents: write
221 contents: write
222 steps:
222 steps:
223 # Full history and tags for the release notes.
224 - uses: actions/checkout@v6
225 with:
226 fetch-depth: 0
227
223 - uses: actions/download-artifact@v8
228 - uses: actions/download-artifact@v8
224 with:
229 with:
225 path: dist
230 path: dist
226
231
232 # Highlights from the body of the chore(release) commit, then git-cliff's list
233 # of every feat and fix since the previous release (cliff.toml).
234 - name: Release notes
235 env:
236 TAG: ${{ github.ref_name }}
237 GITHUB_TOKEN: ${{ github.token }}
238 GIT_CLIFF_VERSION: 2.14.2
239 GIT_CLIFF_SHA256: 24f397c733add5390fdceee3a2088588ab0d5f944ce00d34cb7029b888cf2db4
240 run: |
241 set -euo pipefail
242 archive="git-cliff-$GIT_CLIFF_VERSION-x86_64-unknown-linux-gnu.tar.gz"
243 curl -fsSL -o "$RUNNER_TEMP/$archive" \
244 "https://github.com/orhun/git-cliff/releases/download/v$GIT_CLIFF_VERSION/$archive" &&
245 echo "$GIT_CLIFF_SHA256 $RUNNER_TEMP/$archive" | sha256sum -c - &&
246 tar -xzf "$RUNNER_TEMP/$archive" -C "$RUNNER_TEMP" || true
247 cliff="$RUNNER_TEMP/git-cliff-$GIT_CLIFF_VERSION/git-cliff"
248 highlights="$(git log -1 --format=%b "$TAG" | grep -v -e '^Co-Authored-By:' -e 'Workspace version' | sed '/./,$!d' || true)"
249 # Notes must never block publishing the assets.
250 if ! {
251 if [[ -n "${highlights//[[:space:]]/}" ]]; then
252 printf '## Highlights\n\n%s\n\n<details>\n<summary>All changes</summary>\n\n' "$highlights"
253 "$cliff" --config cliff.toml --current --strip all
254 printf '\n</details>\n'
255 else
256 "$cliff" --config cliff.toml --current --strip all
257 fi
258 } > "$RUNNER_TEMP/notes.md"; then
259 echo "Release notes could not be generated, see the commits since the previous tag." > "$RUNNER_TEMP/notes.md"
260 fi
261 cat "$RUNNER_TEMP/notes.md"
262
227 # Artifacts drop the executable bit, the tarball restores it.
263 # Artifacts drop the executable bit, the tarball restores it.
228 # Asset names use the version without the leading v (rusty-teams-0.5.0-…).
264 # Asset names use the version without the leading v (rusty-teams-0.5.0-…).
229 - name: Package
265 - name: Package
@@ -293,7 +329,7 @@ jobs:
293 if: steps.package.outputs.publish == 'true'
329 if: steps.package.outputs.publish == 'true'
294 with:
330 with:
295 files: release/*
331 files: release/*
296 generate_release_notes: true
332 body_path: ${{ runner.temp }}/notes.md
297 prerelease: ${{ contains(github.ref_name, '-') }}
333 prerelease: ${{ contains(github.ref_name, '-') }}
298
334
299 - name: Fail when an asset is missing
335 - name: Fail when an asset is missing
.github/workflows/pr-title.yml added +26 −0
@@ -0,0 +1,26 @@
1 # A squash merge uses the PR title as the commit subject, and the release notes
2 # (cliff.toml) show it as is. CONTRIBUTING.md has the format.
3 name: PR title
4
5 on:
6 pull_request:
7 types: [opened, edited, reopened, synchronize]
8
9 permissions: {}
10
11 jobs:
12 title:
13 name: Conventional title
14 runs-on: ubuntu-latest
15 steps:
16 - name: Check
17 env:
18 TITLE: ${{ github.event.pull_request.title }}
19 run: |
20 pattern='^(feat|fix|perf|refactor|docs|test|chore|ci|build)(\([a-z0-9-]+\))?!?: [^[:space:]].*$'
21 if [[ "$TITLE" =~ $pattern ]]; then
22 echo "ok: $TITLE"
23 else
24 echo "::error::PR title must look like 'fix(chat): a sent image no longer blinks' (type(scope): message, no emoji). Got: $TITLE"
25 exit 1
26 fi
@@ -0,0 +1,26 @@
1# A squash merge uses the PR title as the commit subject, and the release notes
2# (cliff.toml) show it as is. CONTRIBUTING.md has the format.
3name: PR title
4
5on:
6 pull_request:
7 types: [opened, edited, reopened, synchronize]
8
9permissions: {}
10
11jobs:
12 title:
13 name: Conventional title
14 runs-on: ubuntu-latest
15 steps:
16 - name: Check
17 env:
18 TITLE: ${{ github.event.pull_request.title }}
19 run: |
20 pattern='^(feat|fix|perf|refactor|docs|test|chore|ci|build)(\([a-z0-9-]+\))?!?: [^[:space:]].*$'
21 if [[ "$TITLE" =~ $pattern ]]; then
22 echo "ok: $TITLE"
23 else
24 echo "::error::PR title must look like 'fix(chat): a sent image no longer blinks' (type(scope): message, no emoji). Got: $TITLE"
25 exit 1
26 fi
CONTRIBUTING.md +2 −1
@@ -25,7 +25,8 @@ Most of this code is written with AI agents, and that is welcome here. Just say
25 25 - One topic per pull request. No unrelated refactors, no formatting of files you did not change.
26 26 - The template asks for three things: a summary, the AI model, and a screenshot for UI changes (taken with demo data).
27 27 - CI runs the tests on Linux and Windows for every pull request.
28 - Commit and title format: `feat|fix|chore|docs(scope): message`.
28 - Commit and PR title format: `type(scope): message`, with `type` one of `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `chore`, `ci`, `build`, a lowercase scope and no emoji. CI checks the PR title.
29 - The PR title becomes the squash commit and a line in the release notes (`feat` under New, `fix` under Fixes). Write it as a user would read it: `fix(chat): a sent image no longer blinks`, not `fix(chat): handle download race`.
29 30 - Rebase on `main` instead of merging it in. Answer actionable review comments or say that you will not.
30 31
31 32 ## Build and test
@@ -25,7 +25,8 @@ Most of this code is written with AI agents, and that is welcome here. Just say
25- One topic per pull request. No unrelated refactors, no formatting of files you did not change.
25- One topic per pull request. No unrelated refactors, no formatting of files you did not change.
26- The template asks for three things: a summary, the AI model, and a screenshot for UI changes (taken with demo data).
26- The template asks for three things: a summary, the AI model, and a screenshot for UI changes (taken with demo data).
27- CI runs the tests on Linux and Windows for every pull request.
27- CI runs the tests on Linux and Windows for every pull request.
28- Commit and title format: `feat|fix|chore|docs(scope): message`.
28- Commit and PR title format: `type(scope): message`, with `type` one of `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `chore`, `ci`, `build`, a lowercase scope and no emoji. CI checks the PR title.
29- The PR title becomes the squash commit and a line in the release notes (`feat` under New, `fix` under Fixes). Write it as a user would read it: `fix(chat): a sent image no longer blinks`, not `fix(chat): handle download race`.
29- Rebase on `main` instead of merging it in. Answer actionable review comments or say that you will not.
30- Rebase on `main` instead of merging it in. Answer actionable review comments or say that you will not.
30
31
31## Build and test
32## Build and test
cliff.toml added +50 −0
@@ -0,0 +1,50 @@
1 # Release notes for GitHub releases, built by git-cliff from conventional commits
2 # (build.yml, release job). Commit and PR titles are the lines users read.
3 [changelog]
4 body = """
5 {% for group, commits in commits | group_by(attribute="group") %}
6 ### {{ group | striptags | trim }}
7 {% for commit in commits | unique(attribute="message") | sort(attribute="scope") %}
8 - {% if commit.scope %}**{{ commit.scope | replace(from="-", to=" ") | upper_first }}:** {% endif %}{{ commit.message | split(pat="\n") | first | trim | upper_first }}\
9 {% if commit.remote.pr_number %} ([#{{ commit.remote.pr_number }}](https://github.com/danieldaeschle/rusty-teams/pull/{{ commit.remote.pr_number }}){% if commit.remote.username and commit.remote.username != "danieldaeschle" %} by @{{ commit.remote.username }}{% endif %}){% endif %}
10 {%- endfor %}
11 {% endfor %}
12 {% if previous.version %}
13 **Full changelog**: https://github.com/danieldaeschle/rusty-teams/compare/{{ previous.version }}...{{ version }}
14 {% endif %}
15 """
16 trim = true
17
18 [git]
19 conventional_commits = true
20 filter_unconventional = true
21 tag_pattern = "^v[0-9]+\\.[0-9]+\\.[0-9]+(-rc\\.[0-9]+)?$"
22 sort_commits = "oldest"
23 commit_preprocessors = [
24 { pattern = "^Merge pull request #[0-9]+:? (from \\S+\\s*)?", replace = "" },
25 { pattern = "^[^a-zA-Z]+", replace = "" },
26 { pattern = "^([^\\n]*?) \\(#[0-9]+\\)", replace = "${1}" },
27 { pattern = "^(\\w+)(!?): ", replace = "${1}(app)${2}: " },
28 { pattern = "^(\\w+)\\((calling|call|calls|call-e2e)\\)", replace = "${1}(calls)" },
29 { pattern = "^(\\w+)\\((chat|chats|messages|conversation)\\)", replace = "${1}(chat)" },
30 { pattern = "^(\\w+)\\((channel|channels)\\)", replace = "${1}(channels)" },
31 { pattern = "^(\\w+)\\((parity|ui)\\)", replace = "${1}(app)" },
32 { pattern = "^(\\w+)\\(ci\\)", replace = "${1}(CI)" },
33 { pattern = "^(\\w+)\\(macos\\)", replace = "${1}(mac)" },
34 { pattern = "^(\\w+)\\(mcp\\)", replace = "${1}(MCP)" },
35 { pattern = "^(\\w+)\\(chatsvc\\)", replace = "${1}(chat)" },
36 ]
37 commit_parsers = [
38 { message = "^chore\\(release\\)", skip = true },
39 { message = "^\\w+\\([^)]*\\): .*\\btests?\\b", skip = true },
40 { message = "^\\w+\\(test\\)", skip = true },
41 { message = "^\\w+\\((CI|packaging|release|flatpak|build)\\)", group = "<!-- 2 -->Packaging and releases" },
42 { message = "^(ci|build)", group = "<!-- 2 -->Packaging and releases" },
43 { message = "^feat", group = "<!-- 0 -->New" },
44 { message = "^(fix|perf)", group = "<!-- 1 -->Fixes" },
45 { message = ".*", skip = true },
46 ]
47
48 [remote.github]
49 owner = "danieldaeschle"
50 repo = "rusty-teams"
@@ -0,0 +1,50 @@
1# Release notes for GitHub releases, built by git-cliff from conventional commits
2# (build.yml, release job). Commit and PR titles are the lines users read.
3[changelog]
4body = """
5{% for group, commits in commits | group_by(attribute="group") %}
6### {{ group | striptags | trim }}
7{% for commit in commits | unique(attribute="message") | sort(attribute="scope") %}
8- {% if commit.scope %}**{{ commit.scope | replace(from="-", to=" ") | upper_first }}:** {% endif %}{{ commit.message | split(pat="\n") | first | trim | upper_first }}\
9{% if commit.remote.pr_number %} ([#{{ commit.remote.pr_number }}](https://github.com/danieldaeschle/rusty-teams/pull/{{ commit.remote.pr_number }}){% if commit.remote.username and commit.remote.username != "danieldaeschle" %} by @{{ commit.remote.username }}{% endif %}){% endif %}
10{%- endfor %}
11{% endfor %}
12{% if previous.version %}
13**Full changelog**: https://github.com/danieldaeschle/rusty-teams/compare/{{ previous.version }}...{{ version }}
14{% endif %}
15"""
16trim = true
17
18[git]
19conventional_commits = true
20filter_unconventional = true
21tag_pattern = "^v[0-9]+\\.[0-9]+\\.[0-9]+(-rc\\.[0-9]+)?$"
22sort_commits = "oldest"
23commit_preprocessors = [
24 { pattern = "^Merge pull request #[0-9]+:? (from \\S+\\s*)?", replace = "" },
25 { pattern = "^[^a-zA-Z]+", replace = "" },
26 { pattern = "^([^\\n]*?) \\(#[0-9]+\\)", replace = "${1}" },
27 { pattern = "^(\\w+)(!?): ", replace = "${1}(app)${2}: " },
28 { pattern = "^(\\w+)\\((calling|call|calls|call-e2e)\\)", replace = "${1}(calls)" },
29 { pattern = "^(\\w+)\\((chat|chats|messages|conversation)\\)", replace = "${1}(chat)" },
30 { pattern = "^(\\w+)\\((channel|channels)\\)", replace = "${1}(channels)" },
31 { pattern = "^(\\w+)\\((parity|ui)\\)", replace = "${1}(app)" },
32 { pattern = "^(\\w+)\\(ci\\)", replace = "${1}(CI)" },
33 { pattern = "^(\\w+)\\(macos\\)", replace = "${1}(mac)" },
34 { pattern = "^(\\w+)\\(mcp\\)", replace = "${1}(MCP)" },
35 { pattern = "^(\\w+)\\(chatsvc\\)", replace = "${1}(chat)" },
36]
37commit_parsers = [
38 { message = "^chore\\(release\\)", skip = true },
39 { message = "^\\w+\\([^)]*\\): .*\\btests?\\b", skip = true },
40 { message = "^\\w+\\(test\\)", skip = true },
41 { message = "^\\w+\\((CI|packaging|release|flatpak|build)\\)", group = "<!-- 2 -->Packaging and releases" },
42 { message = "^(ci|build)", group = "<!-- 2 -->Packaging and releases" },
43 { message = "^feat", group = "<!-- 0 -->New" },
44 { message = "^(fix|perf)", group = "<!-- 1 -->Fixes" },
45 { message = ".*", skip = true },
46]
47
48[remote.github]
49owner = "danieldaeschle"
50repo = "rusty-teams"