Last active
October 8, 2019 11:42
-
-
Save NandanSatheesh/d538ce9e0f9fdaad13be1ed6d38cd272 to your computer and use it in GitHub Desktop.
Common Circle CI Config for Android Apps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
resource_class: large | |
branches: | |
only: | |
- master | |
working_directory: ~/code | |
docker: | |
- image: circleci/android:api-28-alpha | |
environment: | |
JVM_OPTS: -Xmx4608m | |
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"' | |
steps: | |
- checkout | |
- run: | |
name: Set ANDROID_HOME | |
command: echo sdk.dir = $ANDROID_HOME > local.properties | |
- run: | |
name: Export Path | |
command: export PATH=~/.local/bin:$PATH | |
- run: | |
name: Set minify system variable | |
command: echo 'export MINIFY_ENABLED="true"' >> $BASH_ENV | |
- restore_cache: | |
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | |
- run: | |
name: Download Dependencies | |
command: ./gradlew androidDependencies | |
- save_cache: | |
paths: | |
- ~/.gradle | |
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} | |
- run: | |
name: Export Path | |
command: export PATH=~/.local/bin:$PATH | |
- run: | |
name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. | |
command: sudo chmod +x ./gradlew | |
- run: | |
name: Build APKS | |
command: ./gradlew | |
- store_artifacts: | |
path: app/build/outputs/apk | |
destination: reports | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment