-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (60 loc) · 2.03 KB
/
build-apps.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
name: Build and submit apps through Expo EAS
on:
pull_request:
types:
- closed
paths:
- 'mobile/**'
branches:
- main
jobs:
run-script:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
pull-requests: write
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: Check for GOOGLE_SERVICE_ACCOUNT_JSON
run: |
if [ -z "${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}" ]; then
echo "You must provide a GOOGLE_SERVICE_ACCOUNT_JSON secret in this repo's secrets. It must be stored as a Base64 encoded string."
exit 1
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: mobile/package-lock.json
- name: Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: |
cd mobile
npm install --legacy-peer-deps
- name: Write Google service account file
run: |
echo "${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}" | base64 --decode > ./mobile/google-service-account.json
if [ ! -f "./mobile/google-service-account.json" ]; then
echo "Failed to create the google-service-account.json file"
exit 1
fi
if [ ! -s "./mobile/google-service-account.json" ]; then
echo "The google-service-account.json file is empty"
exit 1
fi
- name: Run script
run: |
cd mobile
npm run create-stores-build