chaosflix/.circleci/config.yml
2019-04-30 22:12:50 +02:00

47 lines
No EOL
2 KiB
YAML

version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-28
environment:
JVM_OPTS: -XX\:MaxHeapSize\=2048m -Xmx1536m
MODULE: touch
FLAVOR1: Prod
FLAVOR2: NoFree
BUILD_TYPE: Release
SIGN_CONFIG: "-PchaosflixKeystore=\$KEYSTORE -PchaosflixStorePassword=\$KEYSTORE_PASSWORD -PchaosflixKeyName=\$KEY_NAME -PchaosflixKeyPassword=\$KEYSTORE_PASSWORD"
branches:
only:
- circleCI
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "touch/build.gradle" }}-{{ checksum "leanback/build.gradle" }}-{{ checksum "common/build.gradle" }}
- run:
name: Setup env
command: |
echo "export BUILD_TYPE_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${BUILD_TYPE:0:1}${BUILD_TYPE:1})\"" >> $BASH_ENV
echo "export FLAVOR1_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${FLAVOR1:0:1}${FLAVOR1:1})\"" >> $BASH_ENV
echo "export FLAVOR2_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${FLAVOR2:0:1}${FLAVOR2:1})\"" >> $BASH_ENV
echo $ENCODED_KEYSTORE | base64 --decode >> ${HOME}/repo/keystore.jks
echo 'export KEYSTORE=${HOME}/repo/keystore.jks' >> $BASH_ENV
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- run:
name: Build Touch
command: ./gradlew $SIGN_CONFIG touch:assemble$FLAVOR1_LOWER$FLAVOR2$BUILD_TYPE
- run:
name: Build Leanback
command: ./gradlew $SIGN_CONFIG Leanback:assemble$FLAVOR1_LOWER$BUILD_TYPE
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "touch/build.gradle" }}-{{ checksum "leanback/build.gradle" }}-{{ checksum "common/build.gradle" }}
- store_artifacts:
path: touch/build/outputs/apk
destination: touch
- store_artifacts:
path: leanback/build/outputs/apk
destination: leanback