Create test-build.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
build-android-debug-armv8: | |
name: Build Android Debug | |
runs-on: ubuntu-latest | |
outputs: | |
debug-artifact-url: ${{ steps.upload-debug.outputs.artifact-url }} | |
steps: | |
- name: Setup Environment (PR) | |
if: ${{ github.event_name == 'pull_request' }} | |
shell: bash | |
run: echo "SHA_SHORT=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)" >> $GITHUB_ENV | |
- name: Setup Environment (Push) | |
if: ${{ github.event_name == 'push' }} | |
shell: bash | |
run: echo "SHA_SHORT=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Generate build files | |
run: npx expo prebuild --platform android | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} | |
- name: Build Debug APK | |
working-directory: android | |
run: | |
./gradlew assembleDebug -PreactNativeArchitectures=arm64-v8a "-Dorg.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m" | |
- name: Upload Debug APK | |
id: upload-debug | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-debug-${{ env.SHA_SHORT }} | |
path: android/app/build/outputs/apk/debug/*.apk |