name: "RN Android Build Apk"

on:
  # push:
  #   branches:
  #     - master
  #   paths:
  #     - "client/mobile/**"
  workflow_dispatch:

jobs:
  install-dependencies:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./client/mobile
    steps:
      - uses: actions/checkout@v3
      - name: Install npm dependencies
        run: |
          yarn
  build-android:
    needs: install-dependencies
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./client/mobile
    steps:
      - uses: actions/checkout@v3
      - name: Install npm dependencies
        run: |
          yarn
      - name: Build Android Release
        run: |
          cd android && ./gradlew assembleRelease
      - name: Upload Artifact
        uses: actions/upload-artifact@v1
        with:
          name: app-release.apk
          path: android/app/build/outputs/apk/release/
