name: Build and Release APK on: push: branches: [ master ] tags: [ 'v*' ] pull_request: branches: [ master ] jobs: build: name: Build APK runs-on: ubuntu-latest container: image: mingc/android-build-box:latest steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Restore Gradle Cache uses: actions/cache@v3 with: path: | ~/.gradle/caches ~/.gradle/wrapper key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-gradle- - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build Debug APK run: | for i in 1 2 3; do ./gradlew assembleDebug && exit 0 || { echo "Attempt $i failed, retrying in 30s..."; sleep 30; } done exit 1 - name: Build Release APK run: | for i in 1 2 3; do ./gradlew assembleRelease && exit 0 || { echo "Attempt $i failed, retrying in 30s..."; sleep 30; } done exit 1 - name: Create Release uses: https://gitea.com/actions/gitea-release-action@v1 with: tag_name: "latest" name: "Latest Build" body: "Automated release of Quik Fork with Remotrix integration. Generated from the latest push." files: | presentation/build/outputs/apk/debug/*.apk presentation/build/outputs/apk/release/*.apk env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}