-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the release tagging script (#347)
* Add the release tagging script * Update RELEASING.md Co-authored-by: Anna U <[email protected]>
- Loading branch information
1 parent
11593bd
commit 763bd1f
Showing
2 changed files
with
53 additions
and
17 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
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,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
ROOT_DIR="${SCRIPT_DIR}/../" | ||
cd ${ROOT_DIR} | ||
|
||
print_usage() { | ||
cat <<EOF | ||
Usage: $(basename $0) release_version | ||
All versions MUST NOT begin with 'v'. Example: 1.2.3. | ||
EOF | ||
} | ||
|
||
if [[ $# < 1 ]] | ||
then | ||
print_usage | ||
exit 1 | ||
fi | ||
|
||
release_version=$1 | ||
release_tag="v$1" | ||
|
||
if [[ ! $release_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] | ||
then | ||
echo "Invalid release version: $release_version" | ||
echo "Release version must follow the pattern major.minor.patch, e.g. 1.2.3" | ||
exit 1 | ||
fi | ||
|
||
git tag -m "Release $release_version" -s "$release_tag" | ||
git push origin "$release_tag" |