diff --git a/change_version b/change_version deleted file mode 100755 index aab3b48b..00000000 --- a/change_version +++ /dev/null @@ -1,12 +0,0 @@ -#/bin/bash -echo $1 > VERSION -sed -i -e "s/.*ClientVersion = \"*.*/ClientVersion = \"$1\"/" pkg/stream/constants.go -go fmt ./... -rm pkg/stream/constants.go-e - - -# sed -i -e "s/.*github.com\/rabbitmq\/rabbitmq-stream-go-client@v*.*/go get -u github.com\/rabbitmq\/rabbitmq-stream-go-client@v$1/" README.md -go fmt ./... -# rm README.md-e - -git add VERSION pkg/stream/constants.go README.md diff --git a/create_tag.sh b/create_tag.sh new file mode 100755 index 00000000..73817ebe --- /dev/null +++ b/create_tag.sh @@ -0,0 +1,30 @@ +#/bin/bash + +version=$1 +gpg_key=$2 +regex="^([0-9]+)\.([0-9]+)\.([0-9]+)(-(alpha|beta|rc)\.([0-9]+))?$" +tag="v$version" + +if [ $# -lt 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +if [[ ! $version =~ $regex ]]; then + echo "Invalid version format: $version" + exit 1 +fi + +echo "Updating version and constants to $version" +echo $version > VERSION +sed -i -e "s/.*ClientVersion = \"*.*/ClientVersion = \"$version\"/" pkg/stream/constants.go +go fmt ./... + +echo "" +echo "Committing changes" +git add VERSION pkg/stream/constants.go README.md +git commit -m "rabbitmq-stream-go-client $tag" + +echo "" +echo "Creating and pushing tag $tag" +git tag -a -s -u $gpg_key -m "rabbitmq-stream-go-client $tag" $tag && git push && git push --tags