DEV Community

Ali Abbas
Ali Abbas

Posted on โ€ข Edited on

7 3

React Native ๐Ÿš€ Github Actions

I recently came across Github Actions. It's a powerful tool. So, i thought of giving it a try. So, I used it to automate the build of react native android apk.
I created a GitHub repository for this project.

Check it out here

CGPA Calculator

๐Ÿš€ Github Action for React Native Build

Add the build.yml as follows

.github/workflows/build.yml

in the project.

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

Enter fullscreen mode Exit fullscreen mode

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

After that, builded apk can be found under the artifact section

Rapidtools
Percentage Calculator

Troubleshoot

Gradlew commands not working

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

chmod +x ./gradlew
Enter fullscreen mode Exit fullscreen mode

Gradlew Command Not working in Github Actions React Native

Sentry mobile image

Improving mobile performance, from slow screens to app start time

Based on our experience working with thousands of mobile developer teams, we developed a mobile monitoring maturity curve.

Read more

Top comments (0)

Sentry mobile image

Mobile Vitals: A first step to Faster Apps

Slow startup times, UI hangs, and frozen frames frustrate usersโ€”but theyโ€™re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your appโ€™s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read the guide โ†’

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay