2017-10-01 00:49:43 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-10-01 02:40:44 +08:00
|
|
|
git fetch --unshallow #required for commit count
|
|
|
|
|
2018-04-25 19:46:57 +08:00
|
|
|
cp .travis/google-services.json app/
|
|
|
|
|
2017-10-01 00:49:43 +08:00
|
|
|
if [ -z "$TRAVIS_TAG" ]; then
|
2017-10-28 23:01:17 +08:00
|
|
|
./gradlew clean assembleStandardDebug
|
2017-10-01 00:49:43 +08:00
|
|
|
|
|
|
|
COMMIT_COUNT=$(git rev-list --count HEAD)
|
|
|
|
export ARTIFACT="tachiyomi-r${COMMIT_COUNT}.apk"
|
|
|
|
|
2017-10-28 23:01:17 +08:00
|
|
|
mv app/build/outputs/apk/standard/debug/app-standard-debug.apk $ARTIFACT
|
2017-10-01 00:49:43 +08:00
|
|
|
else
|
2017-10-28 23:01:17 +08:00
|
|
|
./gradlew clean assembleStandardRelease
|
2017-10-01 00:49:43 +08:00
|
|
|
|
2017-11-28 07:21:38 +08:00
|
|
|
TOOLS="$(ls -d ${ANDROID_HOME}/build-tools/* | tail -1)"
|
2017-10-01 00:49:43 +08:00
|
|
|
export ARTIFACT="tachiyomi-${TRAVIS_TAG}.apk"
|
|
|
|
|
2017-10-29 00:26:31 +08:00
|
|
|
${TOOLS}/zipalign -v -p 4 app/build/outputs/apk/standard/release/app-standard-release-unsigned.apk app-aligned.apk
|
2017-10-01 00:49:43 +08:00
|
|
|
${TOOLS}/apksigner sign --ks $STORE_PATH --ks-key-alias $STORE_ALIAS --ks-pass env:STORE_PASS --key-pass env:KEY_PASS --out $ARTIFACT app-aligned.apk
|
|
|
|
fi
|