docs: Add release tagging procedure and finalize-release script

Document the release workflow in AGENTS.md, splitting it into
agent-preparable draft steps and human-only finalization.  Add
scripts/finalize-release which amends the version bump commit with
Signed-off-by, creates a signed tag, and optionally invokes kup-dtc
for upload.  Remove the now-redundant dist and kup targets from the
Makefile.

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2026-05-26 15:20:10 +10:00
parent 5c35036b2c
commit 7fdf750154
3 changed files with 116 additions and 23 deletions

71
scripts/finalize-release Executable file
View file

@ -0,0 +1,71 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Finalize a release (possibly prepared with AI agent assistance)
# Amends the version bump commit to add Signed-off-by, then creates a
# signed annotated tag from the drafted tag message.
set -e
usage() {
echo "Usage: $0 <tag-message-file>" >&2
echo "" >&2
echo "Run this from the repository root with VERSION.txt updated" >&2
echo "and a draft tag message in given file." >&2
exit 1
}
TAG_MSG_FILE="$1"
if [ -z "$TAG_MSG_FILE" ] || [ ! -f "$TAG_MSG_FILE" ]; then
usage
fi
VERSION=$(cat VERSION.txt)
TAG="v${VERSION}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Error: tag $TAG already exists" >&2
exit 1
fi
HEAD_SUBJECT=$(git log -1 --format=%s)
EXPECTED="Bump version to $TAG"
if [ "$HEAD_SUBJECT" != "$EXPECTED" ]; then
echo "Error: HEAD commit subject is:" >&2
echo " $HEAD_SUBJECT" >&2
echo "Expected:" >&2
echo " $EXPECTED" >&2
exit 1
fi
echo "Version: $VERSION"
echo "Tag: $TAG"
echo ""
echo "--- Tag message ---"
cat "$TAG_MSG_FILE"
echo "--- End tag message ---"
echo ""
printf "Proceed? [y/N] "
read answer
case "$answer" in
y|Y) ;;
*) echo "Aborted."; exit 1 ;;
esac
git commit --amend -s --no-edit
git tag -s "$TAG" -F "$TAG_MSG_FILE"
echo ""
echo "Created signed tag $TAG."
echo "Review with: git show $TAG"
echo ""
SCRIPTDIR=$(dirname "$0")
printf "Upload to kernel.org via kup? [y/N] "
read answer
case "$answer" in
y|Y) "$SCRIPTDIR/kup-dtc" "$VERSION" ;;
*) echo "Skipping kup upload." ;;
esac