Skip to content

Commit 659d5a8

Browse files
Add release script (#36)
Add release script and corresponding steps.
1 parent d8d1759 commit 659d5a8

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

release.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
###############################################################################################
4+
### RELEASING OPERATOR-LIB
5+
# Every operator-lib release should have a corresponding git semantic version tag
6+
# begining with `v`, ex.n `v1.2.3`.
7+
#
8+
# STEP 1: Create a release branch with the name vX.Y.x. Example: git checkout -b v1.2.x
9+
#
10+
# STEP 2: Run the release script by providing the operator-lib release version as an argument
11+
# in the above mentioned format. Example: ./release vX.Y.Z
12+
#
13+
# STEP 3: This script will create a release tag locally. Push the release branch and tag:
14+
# git push upstream <release-branch>
15+
# git push upstream <tag-name>, wherein <tag-name> is the release version.
16+
#
17+
# STEP 4: Update the release notes in github with the changes included in corresponding
18+
# operator-lib version.
19+
#################################################################################################
20+
21+
set -eu
22+
23+
if [[ $# != 1 ]]; then
24+
echo "usage: $0 vX.Y.Z"
25+
exit 1
26+
fi
27+
28+
VER=$1
29+
NUMRE="0|[1-9][0-9]*"
30+
PRERE="\-(alpha|beta|rc)\.[1-9][0-9]*"
31+
32+
if ! [[ "$VER" =~ ^v($NUMRE)\.($NUMRE)\.($NUMRE)($PRERE)?$ ]]; then
33+
echo "malformed version: \"$VER\""
34+
exit 1
35+
fi
36+
37+
if ! git diff-index --quiet HEAD --; then
38+
echo "directory has uncommitted files"
39+
exit 1
40+
fi
41+
42+
# Run tests
43+
echo "Running tests"
44+
make check
45+
46+
# Tag the release commit and verify its tag
47+
echo "Creating a new tag for Operator-lib version $VER"
48+
git tag --sign --message "operator-lib $VER" "$VER"
49+
git verify-tag --verbose $VER
50+
51+
# Add reminder on next stpes
52+
echo ""
53+
echo "Done forget to:"
54+
echo ""
55+
echo "git push upstream <release-branch>"
56+
echo "git push upstream $VER"
57+
echo ""
58+
echo "Also update the release notes in github for this tag."

0 commit comments

Comments
 (0)