From 09eb2058bb2ab1bbaf630bfb680aae6fb57a4522 Mon Sep 17 00:00:00 2001 From: MrXEnginner Date: Sat, 12 Jul 2025 18:44:28 -0300 Subject: [PATCH] [CI] Implement workflow for Android --- .github/workflows/build-android.yml | 86 +++++++++++++++++++++++++++++ README.md | 2 + 2 files changed, 88 insertions(+) create mode 100644 .github/workflows/build-android.yml diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml new file mode 100644 index 00000000..82d6c5d9 --- /dev/null +++ b/.github/workflows/build-android.yml @@ -0,0 +1,86 @@ +name: reVC Android + +on: + push: + branches: [ "miami" ] + paths: + - 'android/launcher/**' + - 'src/**' + pull_request: + branches: [ "miami" ] + paths: + - 'android/launcher/**' + - 'src/**' + release: + types: published + + workflow_dispatch: + +permissions: + contents: read + actions: write + +jobs: + build-android: + name: Build Android APK (${{ matrix.variant }}) + runs-on: ubuntu-latest + + strategy: + matrix: + variant: [debug, release] + + defaults: + run: + working-directory: android/launcher + + steps: + - uses: actions/checkout@v4 + with: + clean: true + submodules: recursive + fetch-depth: 0 + + - name: Make gradlew executable + run: chmod +x ./gradlew + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + cache: gradle + + - name: Declare build version + id: vars + shell: bash + env: + HEAD_REF: ${{ github.head_ref || github.ref_name }} + run: | + echo "build_version=$(git describe --always --tags "refs/remotes/origin/${HEAD_REF}")" >> $GITHUB_OUTPUT + + - name: Set up Gradle cache + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + gradle-${{ runner.os }}- + + - name: Clean build (manual only) + if: github.event_name == 'workflow_dispatch' + run: ./gradlew clean + + - name: Set assemble task name + run: echo "ASSEMBLE_TASK=assemble${{ matrix.variant == 'debug' && 'Debug' || 'Release' }}" >> $GITHUB_ENV + + - name: Build ${{ matrix.variant }} APK + run: ./gradlew $ASSEMBLE_TASK --no-daemon --stacktrace --parallel --build-cache + + - name: Upload ${{ matrix.variant }} APK + uses: actions/upload-artifact@v4 + with: + name: revc-${{ matrix.variant }} + path: android/launcher/app/build/outputs/apk/${{ matrix.variant }}/app-${{ matrix.variant }}.apk + if-no-files-found: error \ No newline at end of file diff --git a/README.md b/README.md index 50866e9d..37bb8530 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ We cannot build for PS2 or Xbox yet. If you're interested in doing so, get in to - [Windows OpenGL 64bit](https://nightly.link/mrxenginner/reVC/workflows/reVC_msvc_amd64/miami/reVC_Release_win-amd64-librw_gl3_glfw-oal.zip) - [Linux 64bit](https://nightly.link/mrxenginner/reVC/workflows/build-cmake-conan/miami/ubuntu-18.04-gl3.zip) - [MacOS 64bit x86-64](https://nightly.link/mrxenginner/reVC/workflows/build-cmake-conan/miami/macos-latest-gl3.zip) + - [Android armeabi-v7a](https://nightly.link/mrxenginner/reVC/workflows/build-android/miami/revc-release.zip) + - Extract the downloaded zip over your GTA VC directory and run reVC. The zip includes the binary, updated and additional gamefiles and in case of OpenAL the required dlls. ## Screenshots