From fbf154206641d2e9d21a17ed1d755b1ba1238c16 Mon Sep 17 00:00:00 2001 From: Anna Kapuscinska Date: Fri, 31 May 2024 18:53:06 +0100 Subject: [PATCH] contrib: Add a script for updating upgrade notes [upstream commit 6ec4c8022e33a2f7dfcfc6b237a821094d5a5dc9] It's intended to be used in the release process. Signed-off-by: Anna Kapuscinska --- contrib/update-upgrade-notes.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 contrib/update-upgrade-notes.sh diff --git a/contrib/update-upgrade-notes.sh b/contrib/update-upgrade-notes.sh new file mode 100644 index 00000000000..235e5b42b82 --- /dev/null +++ b/contrib/update-upgrade-notes.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -ex + +if [ -z "$1" ] || [[ ! $1 =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then + echo "USAGE: ./contrib/update-upgrade-notes.sh vX.Y.Z" + exit 1 +fi + +NOTES_DIR="${NOTES_DIR:-contrib/upgrade-notes}" +version=$1 + +# Copy the latest upgrade notes to a version-specific file and create new latest from the template. +# Skip for pre-releases. +if [[ ! "$version" == *"-"* ]]; then + cp "$NOTES_DIR/latest.md" "$NOTES_DIR/$version.md" + cp "$NOTES_DIR/template.md" "$NOTES_DIR/latest.md" +fi