-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release script and corresponding steps.
- Loading branch information
1 parent
d8d1759
commit 659d5a8
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
############################################################################################### | ||
### RELEASING OPERATOR-LIB | ||
# Every operator-lib release should have a corresponding git semantic version tag | ||
# begining with `v`, ex.n `v1.2.3`. | ||
# | ||
# STEP 1: Create a release branch with the name vX.Y.x. Example: git checkout -b v1.2.x | ||
# | ||
# STEP 2: Run the release script by providing the operator-lib release version as an argument | ||
# in the above mentioned format. Example: ./release vX.Y.Z | ||
# | ||
# STEP 3: This script will create a release tag locally. Push the release branch and tag: | ||
# git push upstream <release-branch> | ||
# git push upstream <tag-name>, wherein <tag-name> is the release version. | ||
# | ||
# STEP 4: Update the release notes in github with the changes included in corresponding | ||
# operator-lib version. | ||
################################################################################################# | ||
|
||
set -eu | ||
|
||
if [[ $# != 1 ]]; then | ||
echo "usage: $0 vX.Y.Z" | ||
exit 1 | ||
fi | ||
|
||
VER=$1 | ||
NUMRE="0|[1-9][0-9]*" | ||
PRERE="\-(alpha|beta|rc)\.[1-9][0-9]*" | ||
|
||
if ! [[ "$VER" =~ ^v($NUMRE)\.($NUMRE)\.($NUMRE)($PRERE)?$ ]]; then | ||
echo "malformed version: \"$VER\"" | ||
exit 1 | ||
fi | ||
|
||
if ! git diff-index --quiet HEAD --; then | ||
echo "directory has uncommitted files" | ||
exit 1 | ||
fi | ||
|
||
# Run tests | ||
echo "Running tests" | ||
make check | ||
|
||
# Tag the release commit and verify its tag | ||
echo "Creating a new tag for Operator-lib version $VER" | ||
git tag --sign --message "operator-lib $VER" "$VER" | ||
git verify-tag --verbose $VER | ||
|
||
# Add reminder on next stpes | ||
echo "" | ||
echo "Done forget to:" | ||
echo "" | ||
echo "git push upstream <release-branch>" | ||
echo "git push upstream $VER" | ||
echo "" | ||
echo "Also update the release notes in github for this tag." |