diff --git a/.github/workflows/cachelio-debug-apk.yml b/.github/workflows/cachelio-debug-apk.yml new file mode 100644 index 0000000..df6af7c --- /dev/null +++ b/.github/workflows/cachelio-debug-apk.yml @@ -0,0 +1,71 @@ +name: Cachelio Debug APK + +on: + push: + branches: [main, master] + pull_request: + workflow_dispatch: + +jobs: + build: + name: Build debug APK + runs-on: ubuntu-latest + timeout-minutes: 45 + + env: + SIGNING_KEYSTORE_BASE64: ${{ secrets.SIGNING_KEYSTORE_BASE64 }} + SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} + SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} + SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "17" + + - name: Set up Android SDK + uses: android-actions/setup-android@v3 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Write local.properties + run: echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties + + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', 'gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Decode signing keystore + id: signing + if: env.SIGNING_KEYSTORE_BASE64 != '' + run: | + echo "$SIGNING_KEYSTORE_BASE64" | base64 --decode > "$RUNNER_TEMP/vbrowser.jks" + echo "keystore=$RUNNER_TEMP/vbrowser.jks" >> "$GITHUB_OUTPUT" + + - name: Build debug APK + env: + VBROWSER_KEYSTORE: ${{ steps.signing.outputs.keystore }} + VBROWSER_STORE_PASSWORD: ${{ env.SIGNING_STORE_PASSWORD }} + VBROWSER_KEY_ALIAS: ${{ env.SIGNING_KEY_ALIAS }} + VBROWSER_KEY_PASSWORD: ${{ env.SIGNING_KEY_PASSWORD }} + run: ./gradlew :app:assembleDebug --no-daemon --stacktrace + + - name: Upload debug APK + uses: actions/upload-artifact@v4 + with: + name: cachelio-debug-apk + path: app/build/outputs/apk/debug/*.apk + if-no-files-found: error + retention-days: 30