CI: release notes list firmware changes first, fold docs/tools/CI, and take a curated "Changelog:" line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-18 11:12:48 +01:00
1 parent c8d75947f8
commit 84f6fa03b2
1 file changed
+36 -9
+36 -9
View File
@@ -19,8 +19,9 @@
# body the version the node reports (`ver`: v1.18.0-tth<sha>). Until 12. 11. # body the version the node reports (`ver`: v1.18.0-tth<sha>). Until 12. 11.
# 2026 the tags were tth-<sha8>; pruning and the changelog know both; # 2026 the tags were tth-<sha8>; pruning and the changelog know both;
# the newest KEEP releases stay, older ones are deleted. The body is a # the newest KEEP releases stay, older ones are deleted. The body is a
# changelog since the previous release: our own commits, then the upstream # changelog since the previous release: our own firmware commits, our docs /
# PRs the upstream merges brought in. # tools / CI commits folded, then the upstream PRs the upstream merges brought
# in. A "Changelog: <text>" line in a commit body replaces its subject there.
# nRF52: .uf2 (drag onto the bootloader drive) and .zip (DFU over BLE or # nRF52: .uf2 (drag onto the bootloader drive) and .zip (DFU over BLE or
# serial); ESP32: -merged.bin (fresh install at 0x0) and .bin (update). # serial); ESP32: -merged.bin (fresh install at 0x0) and .bin (update).
# #
@@ -333,18 +334,36 @@ jobs:
# ours: commits on our main itself (first parent); a merge of one of # ours: commits on our main itself (first parent); a merge of one of
# our own branches (feat/...) is unfolded into the branch's commits, # our own branches (feat/...) is unfolded into the branch's commits,
# an upstream merge is left to the upstream list below # an upstream merge is left to the upstream list below
fmt="- %s ([%h]($web/commit/%H))" ourc=()
ours=""
for c in $(git log --first-parent --format=%H "$base..$SHA"); do for c in $(git log --first-parent --format=%H "$base..$SHA"); do
if git rev-parse -q --verify "$c^2" >/dev/null; then if git rev-parse -q --verify "$c^2" >/dev/null; then
git log -1 --format=%s "$c" | grep -q '^Merge upstream' && continue git log -1 --format=%s "$c" | grep -q '^Merge upstream' && continue
# ^base: a merge of main into a branch carries what is released already # ^base: a merge of main into a branch carries what is released already
ours+=$(git log --no-merges --format="$fmt" "$c^1..$c^2" "^$base")$'\n' mapfile -t -O "${#ourc[@]}" ourc < <(git log --no-merges --format=%H "$c^1..$c^2" "^$base")
else else
ours+=$(git log -1 --format="$fmt" "$c")$'\n' ourc+=("$c")
fi fi
done done
ours=${ours%$'\n'} # Firmware changes first; docs, CI, tools and tests folded away. Sorted
# by the files a commit touches, so it holds even for a poor subject.
# A "Changelog: <text>" line in the body replaces the subject in the
# notes ("Changelog: -" leaves the commit out), so the subject can stay
# technical while the notes say what changes for the node.
fw="" other="" nother=0
for c in "${ourc[@]}"; do
line=$(git log -1 --format=%b "$c" | sed -n 's/^Changelog: *//p' | head -1)
[ "$line" = "-" ] && continue
[ -n "$line" ] || line=$(git log -1 --format=%s "$c")
line="- $line ([${c:0:8}]($web/commit/$c))"
if git diff-tree --no-commit-id --name-only -r "$c" |
grep -qE '^(src|examples|variants|lib|boards|arch)/|^platformio\.ini$'; then
fw+="$line"$'\n'
else
other+="$line"$'\n'
nother=$((nother + 1))
fi
done
fw=${fw%$'\n'} other=${other%$'\n'}
# upstream: the first-parent line of each merged upstream branch, # upstream: the first-parent line of each merged upstream branch,
# PR merges as their title, direct commits as their subject # PR merges as their title, direct commits as their subject
declare -A seen=() declare -A seen=()
@@ -375,9 +394,17 @@ jobs:
echo "Od předchozího vydání · since [$prev]($web/releases/tag/$(jq -rn --arg s "$prev" '$s|@uri'))" echo "Od předchozího vydání · since [$prev]($web/releases/tag/$(jq -rn --arg s "$prev" '$s|@uri'))"
echo echo
fi fi
echo "### Změny forku · fork changes" echo "### Změny firmwaru · firmware changes"
echo "${ours:-- žádné · none}" echo "${fw:-- žádné · none}"
echo echo
if [ "$nother" -gt 0 ]; then
echo "<details><summary>Dokumentace, nástroje, CI · docs, tools, CI ($nother)</summary>"
echo
echo "$other"
echo
echo "</details>"
echo
fi
echo "### Z upstreamu MeshCore · from upstream ($n)" echo "### Z upstreamu MeshCore · from upstream ($n)"
[ "$n" -gt 0 ] && printf '%s\n' "${ups[@]:0:$max}" || echo "- žádné · none" [ "$n" -gt 0 ] && printf '%s\n' "${ups[@]:0:$max}" || echo "- žádné · none"
[ "$n" -le "$max" ] || echo "- … a dalších $((n - max)) · and $((n - max)) more" [ "$n" -le "$max" ] || echo "- … a dalších $((n - max)) · and $((n - max)) more"