config.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. version: 2
  2. jobs:
  3. build:
  4. branches:
  5. only:
  6. - master
  7. working_directory: ~/code
  8. docker:
  9. - image: circleci/android:api-29
  10. environment:
  11. JVM_OPTS: -Xmx3200m
  12. steps:
  13. - checkout
  14. - restore_cache:
  15. key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
  16. - run:
  17. name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
  18. command: sudo chmod +x ./gradlew
  19. - run:
  20. name: Run build
  21. command: export TERM=${TERM:-dumb} && ./gradlew clean build
  22. - run: echo $ENCODED_KEYSTORE | base64 --decode --ignore-garbage >> ${HOME}/keystore.jks
  23. - run: echo ‘export KEYSTORE=${HOME}/keystore.jks’ >> $BASH_ENV
  24. - run: echo $DEPLOYMENT_PRIVATE_KEY | base64 --decode --ignore-garbage >> ${HOME}/deployment_private_key.json
  25. - run: echo ‘export PRIVATE_KEY=${HOME}/deployment_private_key.json’ >> $BASH_ENV
  26. - run:
  27. name: Download Dependencies
  28. command: ./gradlew androidDependencies
  29. - save_cache:
  30. paths:
  31. - ~/.gradle
  32. key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
  33. - run:
  34. name: Run Tests
  35. command: ./gradlew lint test
  36. - store_artifacts:
  37. path: app/build/reports
  38. destination: reports
  39. - store_test_results:
  40. path: app/build/test-results
  41. - run:
  42. name: Upload to Google Play
  43. command: ./gradlew publishRelease
  44. # See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples