This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
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 Release process: 1. Change version number in build.gradle 2. Execute ./release.sh * bugfix 1. Fetch all tags from upstream first 2. Fix the case of the first rc version
- Loading branch information
Junghyun Colin Kim
authored and
Brandon Lee
committed
Oct 22, 2019
1 parent
17f4f13
commit aff8374
Showing
2 changed files
with
35 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,10 @@ | ||
#!/usr/local/bin/python | ||
import re | ||
|
||
with open("build.gradle", "r") as f: | ||
l = f.read() | ||
m = re.search("allprojects\s+{\s+version\s+(.*)\s", l) | ||
versionString = m.group(1) | ||
versionString = versionString[1:] | ||
versionString = versionString[:-1] | ||
print versionString |
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,25 @@ | ||
#!/bin/bash | ||
|
||
# Fetch tags from upstream first | ||
git fetch -t git@github.com:klaytn/caver-java.git | ||
|
||
VERSION=$(./find_version.py) | ||
echo "Trying to tag v$VERSION" | ||
git tag | grep "$VERSION\$" | ||
if [ $? -eq 0 ]; then | ||
echo "$VERSION is found in git tag!!! You should upgrade version number first!!!" | ||
echo "Exiting..." | ||
exit 1 | ||
fi | ||
|
||
PREV_RCVERSION_FULL=`git tag | grep "$VERSION" | sort | tail -1` | ||
RCSUFFIX="1" | ||
if [ ! -z "$PREV_RCVERSION_FULL" ]; then | ||
RCSUFFIX=$(echo "${PREV_RCVERSION_FULL##*.}"+1 | bc) | ||
fi | ||
|
||
RCVERSION="v$VERSION-rc.$RCSUFFIX" | ||
echo "tagging $RCVERSION" | ||
|
||
git tag $RCVERSION | ||
git push upstream $RCVERSION |