Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit fc51bd2

Browse files
author
Clément Le Provost
committed
Update Maven release script
1 parent 942dd6b commit fc51bd2

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

release.sh

+19-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -eo pipefail
44

5+
SELF_ROOT=$(cd $(dirname "$0") && pwd)
6+
57
function call_sed(){
68
PATTERN="$1"
79
FILENAME="$2"
@@ -14,8 +16,8 @@ else
1416
fi
1517
}
1618

17-
FILE_BUILD_GRADLE="algoliasearch/common.gradle"
18-
FILE_API_CLIENT="algoliasearch/src/main/java/com/algolia/search/saas/Client.java"
19+
FILE_BUILD_GRADLE="$SELF_ROOT/algoliasearch/common.gradle"
20+
FILE_API_CLIENT="$SELF_ROOT/algoliasearch/src/main/java/com/algolia/search/saas/Client.java"
1921

2022
if [ $# -ne 1 ]; then
2123
echo "$0 | A script to release new versions automatically"
@@ -25,15 +27,24 @@ fi
2527

2628
VERSION_CODE=$1
2729

28-
echo "Updating version code to $VERSION_CODE and committing..."
30+
echo "Updating version code to $VERSION_CODE..."
2931
call_sed "s/(PUBLISH_VERSION =) '.*'/\1 '$VERSION_CODE'/" $FILE_BUILD_GRADLE
3032
call_sed "s/(private final static String version =) \".*\"/\1 \"$VERSION_CODE\"/" $FILE_API_CLIENT
3133

32-
git add $FILE_BUILD_GRADLE $FILE_API_CLIENT && git commit -m "Release $VERSION_CODE"
33-
git --no-pager show --name-status --format="short"
34+
git diff $FILE_BUILD_GRADLE $FILE_API_CLIENT
35+
36+
echo "Uploading flavor 'online'..."
37+
$SELF_ROOT/select-flavor.sh online
38+
$SELF_ROOT/gradlew uploadArchives 1>/dev/null
3439

35-
echo "Updating artifacts..."
36-
./gradlew uploadArchives 1>/dev/null
40+
echo "Uploading flavor 'offline'"
41+
$SELF_ROOT/select-flavor.sh online
42+
$SELF_ROOT/gradlew uploadArchives 1>/dev/null
3743

3844
echo "Success! Closing and releasing new version..."
39-
./gradlew closeAndPromoteRepository 1>/dev/null
45+
$SELF_ROOT/gradlew closeAndPromoteRepository 1>/dev/null
46+
47+
# Revert flavor to original.
48+
git checkout $SELF_ROOT/algoliasearch/build.gradle
49+
50+
echo "IMPORANT: Remember to git commit & tag & push"

0 commit comments

Comments
 (0)