Don't sign apks on PRs

This commit is contained in:
len 2018-02-04 21:25:22 +01:00
parent fdb6446b71
commit 5c2b444eeb
2 changed files with 5 additions and 3 deletions

View File

@ -10,8 +10,10 @@ android:
- android-sdk-license-.+
before_install:
- yes | sdkmanager "platforms;android-27" # workaround for accepting the license
- openssl aes-256-cbc -K $encrypted_5ba4ee4c096f_key -iv $encrypted_5ba4ee4c096f_iv -in "$PWD/.travis/secrets.tar.enc" -out secrets.tar -d
- tar xf secrets.tar
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
openssl aes-256-cbc -K $encrypted_5ba4ee4c096f_key -iv $encrypted_5ba4ee4c096f_iv -in "$PWD/.travis/secrets.tar.enc" -out secrets.tar -d;
tar xf secrets.tar;
fi
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"

View File

@ -19,5 +19,5 @@ for APK in ${APKS[@]}; do
APKDEST="$DEST/$APKNAME"
${TOOLS}/zipalign -v -p 4 $APK $APKDEST
${TOOLS}/apksigner sign --ks $STORE_PATH --ks-key-alias $STORE_ALIAS --ks-pass env:STORE_PASS --key-pass env:KEY_PASS $APKDEST
[[ -z "$TRAVIS_PULL_REQUEST" ]] && ${TOOLS}/apksigner sign --ks $STORE_PATH --ks-key-alias $STORE_ALIAS --ks-pass env:STORE_PASS --key-pass env:KEY_PASS $APKDEST
done