Skip to content

Commit 08909b5

Browse files
authored
create release script (#341)
1 parent a7f02ba commit 08909b5

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

change_version

Lines changed: 0 additions & 12 deletions
This file was deleted.

create_tag.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#/bin/bash
2+
3+
version=$1
4+
gpg_key=$2
5+
regex="^([0-9]+)\.([0-9]+)\.([0-9]+)(-(alpha|beta|rc)\.([0-9]+))?$"
6+
tag="v$version"
7+
8+
if [ $# -lt 2 ]; then
9+
echo "Usage: $0 <version> <gpg_key>"
10+
exit 1
11+
fi
12+
13+
if [[ ! $version =~ $regex ]]; then
14+
echo "Invalid version format: $version"
15+
exit 1
16+
fi
17+
18+
echo "Updating version and constants to $version"
19+
echo $version > VERSION
20+
sed -i -e "s/.*ClientVersion = \"*.*/ClientVersion = \"$version\"/" pkg/stream/constants.go
21+
go fmt ./...
22+
23+
echo ""
24+
echo "Committing changes"
25+
git add VERSION pkg/stream/constants.go README.md
26+
git commit -m "rabbitmq-stream-go-client $tag"
27+
28+
echo ""
29+
echo "Creating and pushing tag $tag"
30+
git tag -a -s -u $gpg_key -m "rabbitmq-stream-go-client $tag" $tag && git push && git push --tags

0 commit comments

Comments
 (0)