@junaid-fts/expo-automation
v1.0.2
Published
Expo Automation Framework
Downloads
57
Readme
🚀 Expo Build Automation (Direct Execution)
Streamline your React Native build and submission workflow. Automate Android & iOS builds and TestFlight submissions directly from your server.
📋 Overview
Expo Build Automation is a web-based tool designed to simplify the complex process of building and deploying Expo apps. Unlike dispersed CI/CD pipelines, this version runs directly on your server, giving you full control over the build environment and execution.
It abstracts away the command-line intricacies (EAS CLI), offering a user-friendly form to:
- Generate/Clone Expo apps.
- inject configuration and credentials dynamically.
- Build & Submit using the server's local resources.
🚀 User Guide
How to Use the Application
Access the Web Interface: Navigate to
http://localhost:3000(or your server's IP).Fill in App Details:
- App Name: Enter a unique slug. This will be used to create a dedicated Git branch
app/<slug>. - Expo Access Token: Your Expo authentication token.
- Source Repo: (Optional) URL of a Template repository to clone. If left blank, a default "Blank" template is used.
- App Name: Enter a unique slug. This will be used to create a dedicated Git branch
Configure Credentials:
- Android: Upload/path to Keystore (or let it auto-generate one).
- iOS: Provide P12 Certificate and Provisioning Profile paths.
Start Build:
- Click Create & Build App.
- Live Logs: You will see real-time logs streaming from the server as it:
- Clones/Scaffolds the app.
- Configures
app.json. - Runs
eas build.
Artifacts:
- Once the build completes, a direct download link (Expo Artifact URL) will be provided.
🏗️ Architecture & Internal Workflow
This branch uses a Direct Server Execution model.
High-Level Flow
graph TD
User[User @ Web UI] -->|Submits Form| API[Next.js API Route]
API -->|Instantiates| Framework[MyFramework Class]
subgraph Server Context
Framework -->|1. Scaffolds| AppDir[Temp App Directory]
Framework -->|2. Injects| Config[app.json / eas.json]
Framework -->|3. Git Ops| Git[Push to Branch app/xyz]
Framework -->|4. Executes| EAS[EAS CLI Process]
end
EAS -->|Builds| Cloud[Expo Cloud Builders]
EAS -->|Submits| Apple[TestFlight]
EAS -.->|Streams Logs| API
API -.->|SSE Stream| UserKey Components (src/lib/framework.ts)
MyFrameworkClass: The core orchestrator that manages the lifecycle of an automated build.App Generation Strategy:
- Branch Reuse: Checks if a branch
app/<appName>already exists in the hosting repo. If so, it reuses it. - Template Cloning: If
repoUrlis provided, it clones that repo. - Scaffolding: If neither, it runs
npx create-expo-appto generate a fresh blank app.
- Branch Reuse: Checks if a branch
Git Management:
- The tool runs inside a Git repository.
- For every new app build, it creates an Orphan Branch (
app/<appName>). - It commits the generated code and pushes it to
origin. This ensures every build has a reproducible source history.
Local Execution:
- Instead of dispatching to GitHub Actions, this tool uses Node.js
spawnandexecSyncto runeas buildcommands locally on the server. - Benefit: Immediate feedback, no external CI dependencies.
- Requirement: The server must be capable of running Node.js processes for extended periods.
- Instead of dispatching to GitHub Actions, this tool uses Node.js
💻 Prerequisites & Setup
Since this runs builds locally, your server environment must be prepared.
System Requirements
- OS: Linux (Ubuntu/Debian recommended), macOS, or Windows using WSL.
- Runtime: Node.js 18+.
- Git: Installed and authenticated (SSH keys or HTTPS credentials stored).
Installation
Clone the Repo:
git clone https://github.com/YourRepo/Expo-Automation.git cd Expo-AutomationInstall Dependencies:
npm installInstall Global Tools: The framework relies on
eas-cli.npm install -g eas-cliEnvironment Variables: Create a
.env.localfile:EXPO_TOKEN=your_token_here (Optional default)
Running the Server
# Development
npm run dev
# Production
npm run build
npm start🔑 Credentials Handling
- Transient: Credentials used during the build are written to
credentials.jsonin a temporary directory. - Cleanup: The temporary directory is deleted after the build completes (success or fail).
- Security: Ensure your server is secure, as credentials exist on the filesystem for the duration of the build.
Built with ❤️ for the Expo Community.
