CI: release notes come out finished -- Czech line, one item per change, computed dependency line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a8ec3710ac
commit
108245e55b
2 files changed
+162
-84
No files matched your search
@@ -21,7 +21,9 @@
|
||||
# the newest KEEP releases stay, older ones are deleted. The body is a
|
||||
# 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: <text>" line in a commit body replaces its subject there.
|
||||
# in, generated by .github/release-notes.sh (preview it locally; its header
|
||||
# lists the commit trailers: Changelog, Changelog-cs, Changelog-topic) with
|
||||
# one computed line for the build dependencies that moved.
|
||||
# nRF52: .uf2 (drag onto the bootloader drive) and .zip (DFU over BLE or
|
||||
# serial); ESP32: -merged.bin (fresh install at 0x0) and .bin (update).
|
||||
#
|
||||
@@ -451,8 +453,6 @@ jobs:
|
||||
EOF
|
||||
)
|
||||
web="$GITEA/$GITHUB_REPOSITORY"
|
||||
gh=https://github.com/meshcore-dev/MeshCore
|
||||
max=60
|
||||
# changelog against the newest older release that HEAD descends from
|
||||
prev="" base=""
|
||||
while read -r t c; do
|
||||
@@ -470,73 +470,9 @@ jobs:
|
||||
| sort_by(.created_at) | reverse | .[] | "\(.tag_name) \(.target_commitish)"')
|
||||
# no older release: the last 20 commits of our own line
|
||||
[ -n "$base" ] || base=$(git rev-list --first-parent --max-count=21 "$SHA" | tail -1)
|
||||
# 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
|
||||
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
|
||||
mapfile -t -O "${#ourc[@]}" ourc < <(git log --no-merges --format=%H "$c^1..$c^2" "^$base")
|
||||
else
|
||||
ourc+=("$c")
|
||||
fi
|
||||
done
|
||||
# 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,
|
||||
# PR merges as their title, direct commits as their subject
|
||||
declare -A seen=()
|
||||
# A direct upstream commit (no PR) links to GitHub by its ORIGINAL
|
||||
# id: the public export (filter-repo) gives every upstream commit a
|
||||
# new one, which GitHub does not know (30. 11. 2026: "* sec patch"
|
||||
# linked to a 404). Author email + author time survive the rewrite.
|
||||
declare -A upid=()
|
||||
if git fetch -q --no-tags "$gh.git" '+refs/heads/main:refs/upstream/main' '+refs/heads/dev:refs/upstream/dev'; then
|
||||
while read -r h k; do upid[$k]=$h; done < <(git log --format='%H %ae/%at' refs/upstream/main refs/upstream/dev)
|
||||
fi
|
||||
ups=()
|
||||
for m in $(git log --first-parent --merges --grep='^Merge upstream' --format=%H "$base..$SHA"); do
|
||||
for c in $(git log --first-parent --format=%H "$m^1..$m^2"); do
|
||||
s=$(git log -1 --format=%s "$c")
|
||||
if [[ $s =~ ^Merge\ pull\ request\ \#([0-9]+)\ from\ ([^/]+)/(.*)$ ]]; then
|
||||
pr=${BASH_REMATCH[1]}
|
||||
[ -z "${seen[$pr]:-}" ] || continue
|
||||
seen[$pr]=1
|
||||
t=$(git log -1 --format=%b "$c" | sed -n '/./{p;q}')
|
||||
ups+=("- ${t:-${BASH_REMATCH[3]}} ([#$pr]($gh/pull/$pr), ${BASH_REMATCH[2]})")
|
||||
elif [[ $s != Merge* ]]; then
|
||||
[ -z "${seen[$c]:-}" ] || continue
|
||||
seen[$c]=1
|
||||
u=${upid[$(git log -1 --format='%ae/%at' "$c")]:-}
|
||||
if [ -n "$u" ]; then
|
||||
ups+=("- $s ([${u:0:7}]($gh/commit/$u))")
|
||||
else
|
||||
ups+=("- $s ([${c:0:7}]($web/commit/$c))")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
n=${#ups[@]}
|
||||
# our commits, moved build dependencies, upstream PRs -- the
|
||||
# generator is a script so the notes can be previewed locally
|
||||
changes=$(bash .github/release-notes.sh "$base" "$SHA" "$web")
|
||||
body=$(
|
||||
echo "$TITLE"
|
||||
echo
|
||||
@@ -546,20 +482,7 @@ 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 firmwaru · firmware changes"
|
||||
echo "${fw:-- žádné · none}"
|
||||
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)"
|
||||
[ "$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"
|
||||
echo "$changes"
|
||||
echo
|
||||
echo "### Po flashi · after flashing"
|
||||
echo
|
||||
|
||||
Reference in new issue
Block a user