name: Build Android on: [pull_request, push] jobs: build: runs-on: ubuntu-latest container: image: docker://fabernovel/android:api-33-v1.7.0 steps: - name: Checkout the code uses: actions/checkout@v2 - name: Gradle cache uses: actions/cache@v3 with: path: | /root/.gradle/caches /root/.gradle/wrapper key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - name: Prepare signing run: | touch keystore.properties echo "storePassword=${{ secrets.STOREPASSWORD }}" >> keystore.properties echo "keyPassword=${{ secrets.KEYPASSWORD }}" >> keystore.properties echo "keyAlias=key0" >> keystore.properties echo "storeFile=../AndroidKey" >> keystore.properties - name: Generate versionCode run: | touch version.properties let timestamp=$(date +%s)/10 echo "versionCode=$timestamp" >> version.properties - name: Build the app run: ./gradlew build