Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/realabbas/Github-Actions-React-Native
Github Action for React Native Build 🦊
https://github.com/realabbas/Github-Actions-React-Native
android automation build-automation github-actions javascript react-native yml
Last synced: 7 days ago
JSON representation
Github Action for React Native Build 🦊
- Host: GitHub
- URL: https://github.com/realabbas/Github-Actions-React-Native
- Owner: realabbas
- License: mit
- Created: 2020-04-10T14:37:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-17T08:58:20.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T07:24:46.596Z (13 days ago)
- Topics: android, automation, build-automation, github-actions, javascript, react-native, yml
- Language: Dockerfile
- Homepage:
- Size: 81.1 KB
- Stars: 160
- Watchers: 6
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![Github Action for React Native Build](https://raw.githubusercontent.com/realabbas/Github-Actions-React-Native/master/demo/github%20action.png)
This github action automatically builds the android apk under the artifact section whenever a commit is pushed into the master branch
![Visitors](https://visitor-badge.glitch.me/badge?page_id=realabbas.github-actions-react-native)
## Installation
Add the *action.yml* as follows ``` .github/workflows/build.yml ``` in the project.
For more reference see the official [docs](https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#creating-a-workflow-file)```
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
```