name: Android CI

on:
  push:
    branches: [ dev ]
  pull_request:
    branches: [ dev ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: set up JDK 11
      uses: actions/setup-java@v2
      with:
        java-version: '11'
        distribution: 'temurin'
        cache: gradle

    - name: Generate temporary keystore
      run: keytool -genkey -v -storetype pkcs12 -keystore store.p12 -storepass android -alias android -keyalg RSA -keysize 2048 -validity 10000 -dname CN=CI
    - name: Write retro.properties
      run: |
        cat >retro.properties <<EOF
        storeFile=$PWD/store.p12
        keyAlias=android
        storePassword=android
        keyPassword=android
        EOF
    - name: Build with Gradle
      run: ./gradlew build
