From 9840076f3108436301337f49df44e80f8bfc0b0b Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 11 Oct 2017 12:55:12 +0900 Subject: [PATCH] Update release scripts --- build.gradle | 2 +- prepare-release.bash | 30 +++++++++++++++++++++--------- publish-release.sh | 18 +++--------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index 3b5d5632..9cfd660c 100644 --- a/build.gradle +++ b/build.gradle @@ -95,7 +95,7 @@ task cleanNative(type: Delete) { play { jsonFile = file('keys.json') uploadImages = false - track = 'beta' + track = 'production' } /** diff --git a/prepare-release.bash b/prepare-release.bash index e67c31de..f58a1186 100755 --- a/prepare-release.bash +++ b/prepare-release.bash @@ -4,7 +4,7 @@ set -e NEW_VERSION_NAME=$1 OLD_VERSION_NAME=$(grep "versionName" "build.gradle" | awk '{print $2}') -if [[ -z $NEW_VERSION_NAME ]] +if [[ -z ${NEW_VERSION_NAME} ]] then echo "New version name is empty. Please set a new version. Current version: $OLD_VERSION_NAME" exit @@ -20,15 +20,15 @@ cd "ext/syncthing/src/github.com/syncthing/syncthing/" git fetch CURRENT_TAG=$(git describe) LATEST_TAG=$(git tag --sort=taggerdate | awk '!/rc/' | tail -1) -if [ $CURRENT_TAG != $LATEST_TAG ] +if [ ${CURRENT_TAG} != ${LATEST_TAG} ] then - git checkout -f $LATEST_TAG - cd $PROJECT_DIR + git checkout -f ${LATEST_TAG} + cd ${PROJECT_DIR} git add "ext/syncthing/src/github.com/syncthing/syncthing" git commit -m "Updated Syncthing to $LATEST_TAG" ./gradlew cleanNative buildNative fi -cd $PROJECT_DIR +cd ${PROJECT_DIR} echo " @@ -51,10 +51,22 @@ fi echo " -Running Tests +Running Lint ----------------------------- " -./gradlew clean lint +./gradlew clean lintVitalRelease + +echo " + +Enter Changelog for $NEW_VERSION_NAME +----------------------------- +" +changelog_file="build/changelog.tmp" +touch ${changelog_file} +nano ${changelog_file} + +cat ${changelog_file} +mv ${changelog_file} "src/main/play/en-GB/whatsnew" echo " @@ -67,9 +79,9 @@ sed -i "s/versionCode $OLD_VERSION_CODE/versionCode $NEW_VERSION_CODE/" build.gr OLD_VERSION_NAME=$(grep "versionName" "build.gradle" | awk '{print $2}') sed -i "s/$OLD_VERSION_NAME/\"$1\"/" build.gradle -git add "build.gradle" +git add "build.gradle" "src/main/play/en-GB/whatsnew" git commit -m "Bumped version to $NEW_VERSION_NAME" -git tag $NEW_VERSION_NAME +git tag ${NEW_VERSION_NAME} echo " Update ready. diff --git a/publish-release.sh b/publish-release.sh index 2dd56df5..4d2f65b5 100755 --- a/publish-release.sh +++ b/publish-release.sh @@ -2,7 +2,7 @@ set -e -version=$(git describe --always) +version=$(git describe --tags) regex='^[0-9]+\.[0-9]+\.[0-9]+$' if [[ ! ${version} =~ $regex ]] then @@ -22,28 +22,16 @@ version=`git describe --tags --abbrev=0` echo " -Enter Changelog for $version ------------------------------ -" -changelog_file="build/changelog.tmp" -touch ${changelog_file} -nano ${changelog_file} - -changelog=`cat ${changelog_file}` -mv ${changelog_file} "src/main/play/en-GB/whatsnew" - -echo " - Push to Google Play ----------------------------- " read -s -p "Enter signing password: " password -SIGNING_PASSWORD=$password ./gradlew assembleRelease +SIGNING_PASSWORD=${password} ./gradlew assembleRelease # Upload apk and listing to Google Play -SIGNING_PASSWORD=$password ./gradlew publishRelease +SIGNING_PASSWORD=${password} ./gradlew publishRelease echo "