Infinite Red Harris Robin Dec 5, 2024

Automated EAS Updates in a bare React Native app with Multiple Flavors & Schemes

Article Summary

Harris Robin from Infinite Red tackles the Microsoft CodePush sunset head-on with a comprehensive guide to migrating bare React Native apps to EAS Updates—complete with multi-flavor support and full CI/CD automation.

With Microsoft retiring App Center and CodePush, React Native teams need alternatives for over-the-air updates. This deep-dive tutorial shows how to integrate Expo's EAS Updates into bare React Native projects using Fastlane, supporting multiple build schemes (Dev, QA, Prod) without sacrificing developer experience.

Key Takeaways

Critical Insight

Teams can now run EAS Updates in bare React Native apps with multiple schemes, fully automated through Fastlane, eliminating manual version management and config updates.

The guide reveals a clever trick for storing and incrementing runtime versions that most teams overlook when setting up their CI/CD pipeline.

About This Article

Problem

React Native apps with multiple flavors and schemes couldn't dynamically manage EAS Updates channels and runtime versions. Developers had to manually update iOS Expo.plist, Android AndroidManifest.xml, and app.config.ts files for each build.

Solution

Harris Robin wrote Fastlane Ruby scripts using plist and nokogiri gems to automatically inject channel names and runtime versions into native config files. The scripts pull a single source of truth from GitHub's repo description via API during builds.

Impact

Developers can now run a single command like `bundle exec fastlane increment_expo_runtime_version segment:patch track:alpha` to increment runtime versions. This removes the need to manually update three separate files and makes CI/CD pipelines fully automated for multiple app variants.