From 2da6ca07c065db5f24bf47cbf70510c80e3190ba Mon Sep 17 00:00:00 2001 From: Hristo Temelski Date: Wed, 10 Sep 2025 15:01:18 +0300 Subject: [PATCH] chore(release): Update the rest of the versions (#3513) * chore(release): Update the rest of the versions * improved tag script --- example/del-keys-without-ttl/go.mod | 2 +- example/otel/go.mod | 4 +-- extra/rediscensus/go.mod | 2 +- extra/redisotel/go.mod | 2 +- scripts/tag.sh | 54 +++++++++++++++++++++++------ 5 files changed, 48 insertions(+), 16 deletions(-) diff --git a/example/del-keys-without-ttl/go.mod b/example/del-keys-without-ttl/go.mod index c2dc9e30..8bc85d6c 100644 --- a/example/del-keys-without-ttl/go.mod +++ b/example/del-keys-without-ttl/go.mod @@ -5,7 +5,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. require ( - github.com/redis/go-redis/v9 v9.13.0 + github.com/redis/go-redis/v9 v9.14.0 go.uber.org/zap v1.24.0 ) diff --git a/example/otel/go.mod b/example/otel/go.mod index e5c4e49c..e08367e8 100644 --- a/example/otel/go.mod +++ b/example/otel/go.mod @@ -11,7 +11,7 @@ replace github.com/redis/go-redis/extra/redisotel/v9 => ../../extra/redisotel replace github.com/redis/go-redis/extra/rediscmd/v9 => ../../extra/rediscmd require ( - github.com/redis/go-redis/extra/redisotel/v9 v9.13.0 + github.com/redis/go-redis/extra/redisotel/v9 v9.14.0 github.com/redis/go-redis/v9 v9.14.0 github.com/uptrace/uptrace-go v1.21.0 go.opentelemetry.io/otel v1.22.0 @@ -25,7 +25,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect - github.com/redis/go-redis/extra/rediscmd/v9 v9.13.0 // indirect + github.com/redis/go-redis/extra/rediscmd/v9 v9.14.0 // indirect go.opentelemetry.io/contrib/instrumentation/runtime v0.46.1 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect diff --git a/extra/rediscensus/go.mod b/extra/rediscensus/go.mod index 2d0a612e..05a21ad0 100644 --- a/extra/rediscensus/go.mod +++ b/extra/rediscensus/go.mod @@ -7,7 +7,7 @@ replace github.com/redis/go-redis/v9 => ../.. replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd require ( - github.com/redis/go-redis/extra/rediscmd/v9 v9.13.0 + github.com/redis/go-redis/extra/rediscmd/v9 v9.14.0 github.com/redis/go-redis/v9 v9.14.0 go.opencensus.io v0.24.0 ) diff --git a/extra/redisotel/go.mod b/extra/redisotel/go.mod index aa8fac5b..f6204ca3 100644 --- a/extra/redisotel/go.mod +++ b/extra/redisotel/go.mod @@ -7,7 +7,7 @@ replace github.com/redis/go-redis/v9 => ../.. replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd require ( - github.com/redis/go-redis/extra/rediscmd/v9 v9.13.0 + github.com/redis/go-redis/extra/rediscmd/v9 v9.14.0 github.com/redis/go-redis/v9 v9.14.0 go.opentelemetry.io/otel v1.22.0 go.opentelemetry.io/otel/metric v1.22.0 diff --git a/scripts/tag.sh b/scripts/tag.sh index 121f00e0..28bdda88 100755 --- a/scripts/tag.sh +++ b/scripts/tag.sh @@ -2,22 +2,45 @@ set -e +DRY_RUN=1 + +if [ $# -eq 0 ]; then + echo "Error: Tag version is required" + help +fi + +TAG=$1 +shift + +while getopts "t" opt; do + case $opt in + t) + DRY_RUN=0 + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + esac +done + help() { cat <<- EOF -Usage: TAG=tag $0 +Usage: $0 TAGVERSION [-t] Creates git tags for public Go packages. -VARIABLES: - TAG git tag, for example, v1.0.0 +ARGUMENTS: + TAGVERSION Tag version to create, for example v1.0.0 + +OPTIONS: + -t Execute git commands (default: dry run) EOF exit 0 } -if [ -z "$TAG" ] -then - printf "TAG env var is required\n\n"; - help +if [ "$DRY_RUN" -eq 1 ]; then + echo "Running in dry-run mode" fi if ! grep -Fq "\"${TAG#v}\"" version.go @@ -31,12 +54,21 @@ PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; \ | sed 's/^\.\///' \ | sort) -git tag ${TAG} -git push origin ${TAG} + +execute_git_command() { + if [ "$DRY_RUN" -eq 0 ]; then + "$@" + else + echo "DRY-RUN: Would execute: $@" + fi +} + +execute_git_command git tag ${TAG} +execute_git_command git push origin ${TAG} for dir in $PACKAGE_DIRS do printf "tagging ${dir}/${TAG}\n" - git tag ${dir}/${TAG} - git push origin ${dir}/${TAG} + execute_git_command git tag ${dir}/${TAG} + execute_git_command git push origin ${dir}/${TAG} done