Skip to content
archive

GitHub Action

React Native Android Build APK

v1.1.2 Latest version

React Native Android Build APK

archive

React Native Android Build APK

This github action automatically builds the android apk under the artifact section

Installation

Copy and paste the following snippet into your .yml file.

              

- name: React Native Android Build APK

uses: realabbas/[email protected]

Learn more about this action in realabbas/Github-Actions-React-Native

Choose a version

Github Action for React Native Build

This github action automatically builds the android apk under the artifact section whenever a commit is pushed into the master branch

Visitors

Installation

Add the action.yml as follows .github/workflows/build.yml in the project. For more reference see the official docs

name: react-native-android-build-apk
on:
  push:
    branches:
      - master
jobs:
  install-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install npm dependencies
        run: |
          npm install
  build-android:
    needs: install-and-test
    runs-on: ubuntu-latest
    steps: 
      - uses: actions/checkout@v3
      - name: Install npm dependencies
        run: |
          npm install
      - 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/

Build will be triggered as soon as the commit is pushed to the master branch.

Troubleshoot

Gradlew commands not working

You can try to execute the following command before run gradle commands.

chmod +x ./gradlew