1+ #! /bin/bash
2+ set -e
3+
4+ cd $( dirname $0 )
5+
6+ # ##########################
7+ # VALIDATE GEOFIRE REPO #
8+ # ##########################
9+ # Ensure the checked out geofire branch is master
10+ CHECKED_OUT_BRANCH=" $( git branch | grep " *" | awk -F ' ' ' {print $2}' ) "
11+ if [[ $CHECKED_OUT_BRANCH != " master" ]]; then
12+ echo " Error: Your FirebaseUI-Android repo is not on the master branch."
13+ exit 1
14+ fi
15+
16+ # Make sure the geofire branch does not have existing changes
17+ if ! git --git-dir=" .git" diff --quiet; then
18+ echo " Error: Your FirebaseUI-Android repo has existing changes on the master branch. Make sure you commit and push the new version before running this release script."
19+ exit 1
20+ fi
21+
22+ # #############################
23+ # VALIDATE CLIENT VERSIONS #
24+ # #############################
25+
26+ VERSION=$( grep version pom.xml | head -2| tail -1| awk -F ' >' ' {print $2}' | awk -F ' <' ' {print $1}' | awk -F ' -' ' {print $1}' )
27+ read -p " We are releasing $VERSION , is this correct? (press enter to continue) " DERP
28+ if [[ ! -z $DERP ]]; then
29+ echo " Cancelling release, please update pom.xml to desired version"
30+ fi
31+
32+ # Ensure there is not an existing git tag for the new version
33+ # XXX this is wrong; needs to be semver sorted as my other scripts are
34+ LAST_GIT_TAG=" $( git tag --list | tail -1 | awk -F ' v' ' {print $2}' ) "
35+ if [[ $VERSION == $LAST_GIT_TAG ]]; then
36+ echo " Error: git tag v${VERSION} already exists. Make sure you are not releasing an already-released version."
37+ exit 1
38+ fi
39+
40+ # Create docs
41+ ./create-docs.sh
42+ if [[ $? -ne 0 ]]; then
43+ echo " error: There was an error creating the docs."
44+ exit 1
45+ fi
46+
47+ # ##################
48+ # DEPLOY TO MAVEN #
49+ # ##################
50+ read -p " Next, make sure this repo is clean and up to date. We will be kicking off a deploy to maven." DERP
51+ mvn clean
52+ mvn release:clean release:prepare release:perform -Dtag=v$VERSION
53+
54+ if [[ $? -ne 0 ]]; then
55+ echo " error: Error building and releasing to maven."
56+ exit 1
57+ fi
58+
59+ # #############
60+ # UPDATE GIT #
61+ # #############
62+
63+ # Push the new git tag created by Maven
64+ git push --tags
65+ if [[ $? -ne 0 ]]; then
66+ echo " Error: Failed to do 'git push --tags' from geofire repo."
67+ exit 1
68+ fi
69+
70+ # ###############
71+ # MANUAL STEPS #
72+ # ###############
73+
74+ echo " Manual steps:"
75+ echo " 1) release maven repo at http://oss.sonatype.org/"
76+ echo " 2) Deploy new docs: $> firebase deploy"
77+ echo " 3) Update the release notes for FirebaseUI-Android version ${VERSION} on GitHub and add jars for downloading"
78+ echo " 4) Update firebase-versions.json in the firebase-clients repo with the changelog information"
79+ echo " 5) Tweet @FirebaseRelease: 'v${VERSION} of FirebaseUI-Android is available https://github.com/firebase/FirebaseUI-Android"
80+ echo ---
81+ echo " Done! Woo!"
0 commit comments