Created
June 20, 2019 13:52
-
-
Save giovannicandido/7f316eaefe16f6dcbd98c4b919cbb4cd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
CURRENT_VERSION=`cat ./gradle.properties | grep ^version= | cut -d= -f2` | |
echo "Current version $CURRENT_VERSION" | |
CURRENT_BUILD=`echo $CURRENT_VERSION | cut -d. -f4 | cut -d- -f2` | |
NEXT_BUILD=$((CURRENT_BUILD+1)) | |
MAJOR=`echo $CURRENT_VERSION | cut -d. -f1` | |
MINOR=`echo $CURRENT_VERSION | cut -d. -f2` | |
FIX=`echo $CURRENT_VERSION | cut -d. -f3` | |
NEW_VERSION=$MAJOR.$MINOR.$FIX.build-$NEXT_BUILD | |
echo "publishing new version $CURRENT_VERSION" | |
./gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=$CURRENT_VERSION -Prelease.newVersion=$NEW_VERSION | |
echo "next version will be $NEW_VERSION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment