Skip to content

Commit

Permalink
chore: Update build workflows for Android and iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
thecotne committed Jul 30, 2024
1 parent 0cb79c7 commit 9ab219b
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Android Build

on:
workflow_call:
inputs:
environment:
required: false
type: string
default: release

jobs:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install Node modules
run: npm ci

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 20
cache: gradle

- name: Build Android (Release)
if: inputs.environment == 'release'
run: npm exec -- react-native build-android --tasks bundleRelease,assembleRelease

- name: Build Android (Debug)
if: inputs.environment == 'debug'
run: npm exec -- react-native build-android --tasks bundleDebug,assembleDebug

- name: Upload Android Bundle
uses: actions/upload-artifact@v4
with:
name: app-${{inputs.environment}}.aab
path: android/app/build/outputs/bundle/${{inputs.environment}}/app-${{inputs.environment}}.aab

- name: Upload Android APK
uses: actions/upload-artifact@v4
with:
name: app-${{inputs.environment}}.apk
path: android/app/build/outputs/apk/${{inputs.environment}}/app-${{inputs.environment}}.apk
29 changes: 29 additions & 0 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: iOS Build

on:
workflow_call:

jobs:
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm

- name: Install Node modules
run: npm ci

- name: Install CocoaPods
run: bundle install

- name: Install Pods
run: bundle exec pod install
working-directory: ios

- name: Build iOS (Debug)
run: npm exec -- react-native build-ios
14 changes: 14 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Pull Request

on:
pull_request:
branches:
- "main"

jobs:
build-android:
uses: ./.github/workflows/build-android.yml
secrets: inherit
build-ios:
uses: ./.github/workflows/build-ios.yml
secrets: inherit

0 comments on commit 9ab219b

Please sign in to comment.