Files
lucisv/tools/release_notes.sh
T
Guoliang ChenandClaude Mythos 5.2 71d13b5fbe
ci / checks (push) Successful in 1m0s
ci / corpus (push) Successful in 18s
ci / linux (push) Successful in 6m4s
release / build-and-publish (push) Successful in 5m31s
Release 0.66.2: every source file names its author
Every tracked file that can carry a comment (880 of them) now opens with
"Author: Guoliang Chen, a Senior Digital Design Engineer" and closes with
"Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love,
luciochen.com", in the file's own comment syntax. No behaviour change: the
diff outside the version bump and changelogs is comment lines only.

- tools/stamp_author.py: writes the lines; idempotent, `--check` lists
  what is missing. Headers go under a shebang and under Markdown front
  matter.
- Left alone: test fixtures, cases and snapshots (byte-exact inputs), JSON
  and JSONL, logs, images, lockfiles, docs/site/dist (regenerated) and the
  LICENSE files (already carry the copyright line).
- tools/linux_check.sh: --help reads its header from line 3, now that the
  author line sits under the shebang.
- tools/gates.sh green on this tree: 5 545 tests, corpus 814/6 as before.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-24 12:11:09 -08:00

35 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Author: Guoliang Chen, a Senior Digital Design Engineer
# Print the CHANGELOG.md section for one version on stdout.
#
# Usage: tools/release_notes.sh <version> [changelog]
# tools/release_notes.sh 0.7.1 # section between "## 0.7.1 ..."
# # and the next "## " heading
#
# A missing or empty section is an error: the release workflow uses this to
# publish release notes, and every release ships with real, written notes —
# failing here fails the release, which is the point.
set -eu
[ $# -ge 1 ] || { echo "usage: $0 <version> [changelog]" >&2; exit 2; }
version=$1
changelog=${2:-CHANGELOG.md}
[ -r "$changelog" ] || { echo "cannot read $changelog" >&2; exit 2; }
notes=$(awk -v v="$version" '
$1 == "##" { grab = ($2 == v); next }
grab { print }
' "$changelog")
# Trim leading/trailing blank lines so the release body starts with content.
notes=$(printf '%s' "$notes" | sed -e '/./,$!d' | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}')
[ -n "$notes" ] || {
echo "no CHANGELOG.md section for version $version -- write one before tagging" >&2
exit 1
}
printf '%s\n' "$notes"
# Author: Guoliang Chen. Lucisv is made by Guoliang Chen with love, luciochen.com