build: generate crates/tui/CHANGELOG.md as a 15-release slice instead of a full manual copy

The /change command embeds this file into every binary via include_str!;
it now carries only recent releases (regenerated by scripts/sync-changelog.sh,
wired into the release checklist). The explicit-version test derives its
fixture versions from the embedded slice instead of hardcoding old ones.
This commit is contained in:
Hunter B
2026-06-09 23:22:00 -07:00
parent 258d75376c
commit b4edb4e1ef
4 changed files with 36 additions and 4750 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env sh
# Regenerate crates/tui/CHANGELOG.md from the workspace root CHANGELOG.md.
# The /change command embeds this file into the binary via include_str!, so
# it deliberately keeps only the most recent release sections.
#
# Usage: scripts/sync-changelog.sh [sections-to-keep] (default: 15)
set -eu
KEEP="${1:-15}"
root="$(cd "$(dirname "$0")/.." && pwd)"
awk -v keep="$KEEP" '
/^\[/ && /\]: http/ { exit }
/^## \[/ { count++ }
count > keep { exit }
{ print }
' "$root/CHANGELOG.md" > "$root/crates/tui/CHANGELOG.md"
printf '%s\n' \
'---' \
'' \
'Older releases: [CHANGELOG.md](https://github.com/Hmbown/CodeWhale/blob/main/CHANGELOG.md) and [docs/CHANGELOG_ARCHIVE.md](https://github.com/Hmbown/CodeWhale/blob/main/docs/CHANGELOG_ARCHIVE.md).' \
>> "$root/crates/tui/CHANGELOG.md"
echo "wrote crates/tui/CHANGELOG.md ($(wc -l < "$root/crates/tui/CHANGELOG.md") lines, $KEEP sections kept)"