Skip to content

Commit

Permalink
Add release script to git.
Browse files Browse the repository at this point in the history
  • Loading branch information
glung committed May 23, 2016
1 parent 07b40f2 commit d9bf789
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

set -e
set -x

VERSION=$1
SNAPSHOT=$2

updateToVersion() {
version=$1
sed -i"" "s/VERSION_NAME=.*/VERSION_NAME=$version/" gradle.properties
git add gradle.properties
git diff --quiet --exit-code --cached || git commit -m "Bump version to $version"
}

release() {
updateToVersion "$VERSION"
git tag $VERSION
git push origin "$VERSION"
git push origin master
./gradlew uploadArchives
}

snapshot() {
updateToVersion "$SNAPSHOT"
git push origin master
./gradlew uploadArchives
}

git checkout master && git pull
release
snapshot

0 comments on commit d9bf789

Please sign in to comment.