name: Android CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Check out
      uses: actions/checkout@v4
      with:
        submodules: "recursive"
        fetch-depth: 0

    - name: set up JDK 17
      uses: actions/setup-java@v3
      with:
        distribution: 'temurin'
        java-version: '17'
        cache: gradle

    - name: Grant execute permission for gradlew
      run: chmod +x gradlew
      
    - name: Build with Gradle
      run: ./gradlew assembleRelease
      
    - name: Create PlayIntegrityFix zip
      uses: actions/upload-artifact@v3
      with:
        name: PlayIntegrityFix
        path: out/PlayIntegrityFix.zip
