From aac74da60528be8be396393c545eeae49b7a329f Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Fri, 7 Feb 2025 11:27:00 +0100 Subject: [PATCH] tools: add patch version check to prepare-source.sh Use endoflife.date to check for newer versions of the minor Go version we're using and print a notice. --- tools/prepare-source.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/prepare-source.sh b/tools/prepare-source.sh index d4bb8636e..5a49dd012 100755 --- a/tools/prepare-source.sh +++ b/tools/prepare-source.sh @@ -1,9 +1,20 @@ #!/bin/sh -set -eux +set -eu -# Pin Go and toolbox versions at a reasonable version -go get go@1.22.6 toolchain@1.22.6 +GO_MINOR_VERSION="1.22" +GO_VERSION="${GO_MINOR_VERSION}.6" + +# Check latest Go version for the minor we're using +LATEST=$(curl -s https://endoflife.date/api/go/"${GO_MINOR_VERSION}".json | jq -r .latest) +if test "$LATEST" != "$GO_VERSION"; then + echo "NOTE: A new minor release is available (${LATEST}), consider bumping the project version (${GO_VERSION})" +fi + +set -x + +# Pin Go and toolbox versions +go get "go@${GO_VERSION}" "toolchain@${GO_VERSION}" # Update go.mod and go.sum: go mod tidy