-
Notifications
You must be signed in to change notification settings - Fork 771
137 lines (123 loc) Β· 4.43 KB
/
app-mobile-ota-update-staging.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
134
135
136
137
name: app-mobile OTA staging
on:
workflow_dispatch:
# push:
# branches:
# - master
# paths:
# - "packages/app-mobile/**"
jobs:
update:
name: EAS Update Staging
# runs-on: macos-latest
runs-on: ubuntu-latest
# REQUIRED: limit concurrency when pushing main(default) branch to prevent conflict for this action to update its fingerprint database
concurrency: fingerprint-${{ github.event_name != 'pull_request' && 'main' || github.run_id }}
permissions:
# REQUIRED: Allow comments of PRs
pull-requests: write # Allow comments on PRs
# REQUIRED: Allow updating fingerprint in acton caches
actions: write
env:
EXPO_USE_DEV_SERVER: true
TMPDIR: /tmp # Used for metro caching
NODE_OPTIONS: "--max_old_space_size=4096"
NODE_ENV: production
APP_ENV: staging
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: Check fingerprint
uses: expo/expo-github-action/fingerprint@main
- uses: actions/github-script@v6
if: ${{ github.event_name == 'pull_request' && steps.fingerprint.outputs.fingerprint-diff == '[]' }}
with:
script: |
try {
await github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ['Fingerprint:changed']
})
} catch (e) {
if (e.status != 404) {
throw e;
}
}
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Fingerprint:compatible']
})
- uses: actions/github-script@v6
if: ${{ github.event_name == 'pull_request' && steps.fingerprint.outputs.fingerprint-diff != '[]' }}
with:
script: |
try {
await github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ['Fingerprint:compatible']
})
} catch (e) {
if (e.status != 404) {
throw e;
}
}
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Fingerprint:changed']
})
- 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
- name: π Publish iOS Update
env:
APP_ENV: staging
working-directory: ./packages/app-mobile
if: ${{ hashFiles('./assets/hiddenwebview.html') != '' }}
run: "yarn ios:ota-staging"
continue-on-error: true # prevents from failing CI
- name: π Publish Android Update
working-directory: ./packages/app-mobile
if: ${{ hashFiles('./assets/hiddenwebview.html') != '' }}
env:
APP_ENV: staging
run: "yarn android:ota-staging"
continue-on-error: true # prevents from failing CI