Skip to content

Commit

Permalink
feat(expo) add expo build workflow for profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
lakardion committed Aug 30, 2024
1 parent 99eb831 commit 36f03bd
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def remove_expo_yaml_files():
join(".github/workflows", "expo-pr.yml"),
join(".github/workflows", "expo-teststore-build-android.yml"),
join(".github/workflows", "expo-teststore-build-ios.yml"),
join(".github/workflows", "expo-build.yml"),
]
for file_name in file_names:
if exists(file_name):
Expand Down
66 changes: 66 additions & 0 deletions {{cookiecutter.project_slug}}/.github/workflows/expo-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Manually triggered workflow for creating a build
name: Expo Build with given profile

on:
workflow_dispatch:
inputs:
profile:
description: "Build profile"
required: true
default: "development"
type: choice
# Should match the ones in `eas.json`
options:
- development
- development_simulator
- development_review
- staging
- production
platform:
description: "Platform"
required: true
default: "ios"
type: choice
options:
- android
- ios
- all
clear_cache:
description: "Clear cache"
required: true
default: false
type: "boolean"
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
cache-dependency-path: ./mobile/package-lock.json

- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: 📦 Install dependencies
working-directory: ./mobile
run: npm install

- name: 🚀 Build app
run: |
cd mobile
CLEAR_CACHE_FLAG=""
if [[ ${{ github.event.inputs.clear_cache }} ]]; then
CLEAR_CACHE_FLAG="--clear-cache"
fi
eas build --profile ${{ github.event.inputs.profile }} --platform ${{ github.event.inputs.platform }} --non-interactive $CLEAR_CACHE_FLAG

0 comments on commit 36f03bd

Please sign in to comment.