diff --git a/.github/workflows/pub-release.yml b/.github/workflows/pub-release.yml index 99adc9bd..1ded7f06 100644 --- a/.github/workflows/pub-release.yml +++ b/.github/workflows/pub-release.yml @@ -19,8 +19,9 @@ # body the version the node reports (`ver`: v1.18.0-tth). Until 12. 11. # 2026 the tags were tth-; pruning and the changelog know both; # the newest KEEP releases stay, older ones are deleted. The body is a -# changelog since the previous release: our own commits, then the upstream -# PRs the upstream merges brought in. +# changelog since the previous release: our own firmware commits, our docs / +# tools / CI commits folded, then the upstream PRs the upstream merges brought +# in. A "Changelog: " line in a commit body replaces its subject there. # nRF52: .uf2 (drag onto the bootloader drive) and .zip (DFU over BLE or # 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 # our own branches (feat/...) is unfolded into the branch's commits, # an upstream merge is left to the upstream list below - fmt="- %s ([%h]($web/commit/%H))" - ours="" + ourc=() for c in $(git log --first-parent --format=%H "$base..$SHA"); do if git rev-parse -q --verify "$c^2" >/dev/null; then git log -1 --format=%s "$c" | grep -q '^Merge upstream' && continue # ^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 - ours+=$(git log -1 --format="$fmt" "$c")$'\n' + ourc+=("$c") fi 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: " 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, # PR merges as their title, direct commits as their subject 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 fi - echo "### Změny forku · fork changes" - echo "${ours:-- žádné · none}" + echo "### Změny firmwaru · firmware changes" + echo "${fw:-- žádné · none}" echo + if [ "$nother" -gt 0 ]; then + echo "
Dokumentace, nástroje, CI · docs, tools, CI ($nother)" + echo + echo "$other" + echo + echo "
" + echo + fi echo "### Z upstreamu MeshCore · from upstream ($n)" [ "$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"