language: android
jdk: oraclejdk8

android:
  components:
    - platform-tools
    - tools
    - build-tools-25.0.0
    - android-25
    - extra-google-google_play_services
    - extra-google-m2repository
    - extra-android-m2repository

cache:
  directories:
    - $HOME/.m2
    - $HOME/.gradle

before_install:
  - export TZ=Asia/Kuala_Lumpur

script:
  - ./gradlew clean jacocoTestMockDebugUnitTestCoverage -PdisablePreDex
  - ./gradlew checkstyle

after_success:
  - bash <(curl -s https://codecov.io/bash)

before_deploy:
  - openssl aes-256-cbc -K $encrypted_91c31e58792b_key -iv $encrypted_91c31e58792b_iv -in secure.tar.enc -out secure.tar -d
  - tar xvf secure.tar

deploy:
  - provider: script
    script: ./gradlew generateBetaReleasePlayResources
    skip_cleanup: true
    on:
      branch: dev
  - provider: script
    script: ./gradlew generateProdReleasePlayResources
    skip_cleanup: true
    on:
      branch: master
      tags: true

language: android
jdk: oraclejdk8

android:
  components:
    - platform-tools
    - tools
    - build-tools-25.0.0
    - android-25
    - extra-google-google_play_services
    - extra-google-m2repository
    - extra-android-m2repository

cache:
  directories:
    - $HOME/.m2
    - $HOME/.gradle

before_install:
  - export TZ=Asia/Kuala_Lumpur

script:
  - ./gradlew clean jacocoTestMockDebugUnitTestCoverage -PdisablePreDex
  - ./gradlew checkstyle

after_success:
  - bash <(curl -s https://codecov.io/bash)

before_deploy:
  - openssl aes-256-cbc -K $encrypted_91c31e58792b_key -iv $encrypted_91c31e58792b_iv -in secure.tar.enc -out secure.tar -d
  - tar xvf secure.tar

deploy:
  - provider: script
    script: ./gradlew publishListingBetaRelease
    skip_cleanup: true
    on:
      branch: dev
  - provider: script
    script: ./gradlew generateProdReleasePlayResources
    skip_cleanup: true
    on:
      branch: master
      tags: true

Enable auto deploy for dev branch
Enable auto deploy for dev branch
