Skip to content

Add release script #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions change_version

This file was deleted.

30 changes: 30 additions & 0 deletions create_tag.sh
Original file line number Diff line number Diff line change
@@ -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 <version> <gpg_key>"
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