-
Notifications
You must be signed in to change notification settings - Fork 839
133 lines (116 loc) · 4.43 KB
/
app-mobile-build-production.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: app-mobile build production
on:
# push:
# branches:
# - ios-production
# - android-production
# paths:
# - "packages/app-mobile/**"
workflow_dispatch:
inputs:
platform:
description: Platform (android/ios). Both runs APK + App Store build. APK = apk only
type: choice
required: true
default: ios
options:
- ios
- android-both
- android-apk
jobs:
update:
name: EAS Build Production
runs-on: ubuntu-latest
# runs-on: macos-latest
env:
EXPO_USE_DEV_SERVER: true
TMPDIR: /tmp # Used for metro caching
NODE_OPTIONS: "--max_old_space_size=4096"
NODE_ENV: production
APP_ENV: production
steps:
- name: Check for EXPO_TOKEN
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
exit 1
fi
- name: 📦 Checkout repository
uses: actions/checkout@v3
- name: 🌐 Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Cache Metro
uses: actions/cache@v3
id: cache-metro
with:
path: |
${{ env.TMPDIR }}/metro-cache
${{ env.TMPDIR }}/haste-map*
key: npm-${{ env.NODE_VERSION }}-${{ runner.os }}
- name: 🚀 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 🧶 Install dependencies
run: yarn install --immutable
- name: 🏗️ Build dependencies
env:
NODE_ENV: production
BACKPACK_CONFIG_VERSION: "${{ env.RELEASE_PREFIX }}-latest-beta-${{ github.run_number }}"
BACKPACK_CONFIG_LOG_LEVEL: "none"
# CI!=true so that build warnings aren't treated like errors (for now)
CI: ""
run: yarn build:mobile
##################################################################################
## Workflow Triggers
##################################################################################
- name: 🚀 Build for Apple App Store (workflow trigger)
env:
APP_ENV: production
working-directory: ./packages/app-mobile
if: "contains(github.event.inputs.platform, 'ios')"
run: "yarn ios:build-production"
- name: 🚀 Build for Google Play Store (workflow trigger)
env:
APP_ENV: production
working-directory: ./packages/app-mobile
if: "contains(github.event.inputs.platform, 'android-both')"
run: "yarn android:build-production"
- name: 🚀 Build Android APK (workflow trigger)
env:
APP_ENV: production
working-directory: ./packages/app-mobile
if: "contains(github.event.inputs.platform, 'android-both')"
run: "yarn android:build-production-apk"
# Separately releases the android-apk if that is required
- name: 🚀 Build Android APK (workflow trigger)
env:
APP_ENV: production
working-directory: ./packages/app-mobile
if: "contains(github.event.inputs.platform, 'android-apk')"
run: "yarn android:build-production-apk"
##################################################################################
## Merged into either ios-production or android-production branches
##################################################################################
- name: 🚀 Build for Apple App Store (merged into ios-production branch)
env:
APP_ENV: production
working-directory: ./packages/app-mobile
if: contains(github.ref, 'ios-production')
run: "yarn ios:build-production"
- name: 🚀 Build for Google Play Store (merged into android-production branch)
env:
APP_ENV: production
working-directory: ./packages/app-mobile
if: contains(github.ref, 'android-production')
run: "yarn android:build-production"
- name: 🚀 Build Android APK (merged into android-production branch)
env:
APP_ENV: production
working-directory: ./packages/app-mobile
if: contains(github.ref, 'android-production')
run: "yarn android:build-production-apk"