Skip to content

change package-lock.json #27

change package-lock.json

change package-lock.json #27

Workflow file for this run

name: Build
on:
push:
pull_request:
branches:
- main
- develop
jobs:
build-android-debug:
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 "-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
build-android-release:
name: Build Android Release
runs-on: ubuntu-latest
outputs:
release-artifact-url: ${{ steps.upload-release.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 Release APK
working-directory: android
run:
./gradlew assembleRelease "-Dorg.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m"
- name: Upload Release APK
id: upload-release
uses: actions/upload-artifact@v4
with:
name: app-release-${{ env.SHA_SHORT }}
path: android/app/build/outputs/apk/release/*.apk
comment-on-pr:
if: github.event_name == 'pull_request'
name: Comment on PR
runs-on: ubuntu-latest
needs: [build-android-debug, build-android-release]
permissions:
pull-requests: write
steps:
- name: Get short SHA
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: Comment on PR
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
[Download Debug APK](${{ needs.build-android-debug.outputs.debug-artifact-url }})
[Download Release APK](${{ needs.build-android-release.outputs.release-artifact-url }})
> Latest commit: [${{ env.SHA_SHORT }}](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }})