Automating Local Builds and Deployment for React Native Expo Without EAS #3
-
|
Developers using React Native Expo often face delays with EAS builds, especially on the free tier. To streamline production workflows, it’s important to automate local builds and deployments. How can we achieve this for both Android and iOS without relying on EAS?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Automation is possible by combining the bare workflow, Gradle/Xcode CLI tools, and CI/CD pipelines like Fastlane or GitHub Actions. 1. Android Automation
Example: Bash script for local Android build #!/bin/bash
cd android
# Increment versionCode and versionName automatically
./gradlew assembleRelease
# Path to the APK
APK_PATH=app/build/outputs/apk/release/app-release.apk
# Optional: deploy to connected device
adb install -r $APK_PATH
echo "Android build complete: $APK_PATH"
2. iOS Automation
Fastlane Example: # Fastfile
platform :ios do
desc "Build and distribute iOS app"
lane :beta do
match(type: "appstore") # Automatically fetch provisioning profiles and certificates
build_app(scheme: "YourApp", export_method: "app-store")
upload_to_testflight
end
end
fastlane ios beta
3. CI/CD Integration
GitHub Actions Example (Android) name: Android Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: '11'
- name: Build APK
run: |
cd android
./gradlew assembleRelease
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: app-release.apk
path: app/build/outputs/apk/release/app-release.apk4. Best Practices
Summary
Conclusion: |
Beta Was this translation helpful? Give feedback.
Automation is possible by combining the bare workflow, Gradle/Xcode CLI tools, and CI/CD pipelines like Fastlane or GitHub Actions.
1. Android Automation
Example: Bash script for local Android build