mirror of
https://github.com/dgibson/dtc.git
synced 2026-10-10 08:03:00 -04:00
docs: Improvements to release creation tooling
Introduce prepare-release for the deterministic parts of preparing a release. Update AGENTS.md to use that, rather than using an LLM for deterministic steps. finalize-release now pushes the release commit and tag after signing, and prepares a release announcement mail. Assisted-by: Claude:claude-opus-4-6i Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
040c1f7e29
commit
25a368100a
3 changed files with 109 additions and 16 deletions
|
|
@ -61,6 +61,10 @@ echo "Created signed tag $TAG."
|
|||
echo "Review with: git show $TAG"
|
||||
echo ""
|
||||
|
||||
git push origin main "$TAG"
|
||||
git push github main "$TAG"
|
||||
git push gitlab main "$TAG"
|
||||
|
||||
SCRIPTDIR=$(dirname "$0")
|
||||
|
||||
printf "Upload to kernel.org via kup? [y/N] "
|
||||
|
|
@ -69,3 +73,26 @@ case "$answer" in
|
|||
y|Y) "$SCRIPTDIR/kup-dtc" "$VERSION" ;;
|
||||
*) echo "Skipping kup upload." ;;
|
||||
esac
|
||||
|
||||
TAG_BODY=$(git tag -l --format='%(contents:body)' "$TAG")
|
||||
|
||||
ANNOUNCE="announce-${TAG}.txt"
|
||||
cat > "$ANNOUNCE" <<MAIL
|
||||
To: devicetree-compiler@vger.kernel.org
|
||||
Subject: DTC $VERSION released
|
||||
|
||||
DTC $VERSION is now available.
|
||||
|
||||
Git tree:
|
||||
https://git.kernel.org/pub/scm/utils/dtc/dtc.git
|
||||
|
||||
Tagged release ($TAG):
|
||||
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tag/?h=$TAG
|
||||
|
||||
Tarball:
|
||||
https://kernel.org/pub/software/utils/dtc/dtc-${VERSION}.tar.gz
|
||||
|
||||
$TAG_BODY
|
||||
MAIL
|
||||
|
||||
echo "Announcement draft written to $ANNOUNCE"
|
||||
|
|
|
|||
70
scripts/prepare-release
Executable file
70
scripts/prepare-release
Executable file
|
|
@ -0,0 +1,70 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#
|
||||
# Prepare a release: update VERSION.txt and create the version bump
|
||||
# commit. This handles steps 1 and 2 of the release procedure in
|
||||
# AGENTS.md. Step 3 (drafting the tag message) requires judgement to
|
||||
# categorise and summarise changes, so is left to the caller.
|
||||
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 <version>" >&2
|
||||
echo "" >&2
|
||||
echo " version X.Y.Z or vX.Y.Z" >&2
|
||||
echo "" >&2
|
||||
echo "Example: $0 1.8.1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
RAW="$1"
|
||||
if [ -z "$RAW" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
VERSION="${RAW#v}"
|
||||
|
||||
case "$VERSION" in
|
||||
[0-9]*.[0-9]*.[0-9]*)
|
||||
;;
|
||||
*)
|
||||
echo "Error: version '$VERSION' does not look like X.Y.Z" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
TAG="v${VERSION}"
|
||||
|
||||
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
||||
echo "Error: tag $TAG already exists" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! git diff-index --quiet HEAD; then
|
||||
echo "Error: working tree is dirty; commit or stash first" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$VERSION" > VERSION.txt
|
||||
git add VERSION.txt
|
||||
git commit -m "$(cat <<EOF
|
||||
Bump version to $TAG
|
||||
|
||||
Prepare for a new release.
|
||||
EOF
|
||||
)"
|
||||
|
||||
echo "Building with make..."
|
||||
git clean -fdx
|
||||
make check
|
||||
|
||||
echo ""
|
||||
echo "Building with meson..."
|
||||
git clean -fdx
|
||||
meson setup build
|
||||
meson test -C build
|
||||
|
||||
echo ""
|
||||
echo "All builds and tests passed."
|
||||
echo "Next: draft the tag message to tag-message.txt, then run:"
|
||||
echo " scripts/finalize-release tag-message.txt"
|
||||
Loading…
Add table
Add a link
Reference in a new issue