Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Expo Production

Expo Production #564

name: Expo Production
defaults:
run:
working-directory: apps/expo
on:
push:
branches:
- main
workflow_dispatch:
inputs:
versionType:
description: "Force a major version bump"
required: false
concurrency:
group: expo-production-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-submit:
name: Build and Submit
runs-on: ubuntu-latest
steps:
- name: Set up repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Set up git user
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Find yarn cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Decrypt service_account_key.json and google-services.json
env:
SERVICE_ACCOUNT_KEY_SECRET_PASSPHRASE: ${{ secrets.SERVICE_ACCOUNT_KEY_SECRET_PASSPHRASE }}
GOOGLE_SERVICES_SECRET_PASSPHRASE: ${{ secrets.GOOGLE_SERVICES_SECRET_PASSPHRASE }}
NODE_ENV: production
STAGE: production
run: |
cd ../../scripts
sh ./decrypt_secrets.sh
cd ../apps/expo
- name: Bump the version
id: version
if: ${{ github.event_name == 'workflow_dispatch' }}
run: yarn bump-application-version ${{ github.event.inputs.versionType }}
- name: Set up Expo
uses: expo/expo-github-action@v7
with:
eas-version: latest
eas-cache: true
expo-cache: true
expo-version: 4.x
token: ${{ secrets.EXPO_TOKEN }}
- name: EAS Update
if: steps.version.outputs.type == 'patch'
run: NODE_OPTIONS=--max-old-space-size=5120 EXPO_DEBUG=true NODE_ENV=production STAGE=production eas update --branch production --message "Deploy to production"
- name: Build Android on EAS
if: steps.version.outputs.type == 'major'
run: NODE_ENV=production STAGE=production eas build --platform android --non-interactive --no-wait --auto-submit
- name: Build iOS on EAS
if: steps.version.outputs.type == 'major'
run: NODE_ENV=production STAGE=production eas build --platform ios --non-interactive --no-wait --auto-submit