Skip to content

Instantly share code, notes, and snippets.

@nouvist
Last active August 6, 2022 10:11
Show Gist options
  • Save nouvist/93d63b06cb16848df196cfc7390c10c1 to your computer and use it in GitHub Desktop.
Save nouvist/93d63b06cb16848df196cfc7390c10c1 to your computer and use it in GitHub Desktop.
React Native Github Action
# Github Action for React Native Android
name: React Native Android
on:
workflow_dispatch:
inputs:
bundle:
type: boolean
default: false
release:
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.3.0
run_install: false
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
cache: "gradle"
- name: Install Node modules
run: |
pnpm install --frozen-lockfile
- name: Build
run: |
pnpm jetifier
cd android
chmod +x gradlew
./gradlew ${{fromJSON('["assemble", "bundle"]')[github.event.inputs.bundle == 'true']}}${{fromJSON('["Debug", "Release"]')[github.event.inputs.release == 'true']}}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: app build
path: android/app/build/outputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment