-
-
Notifications
You must be signed in to change notification settings - Fork 360
238 lines (203 loc) · 7.73 KB
/
sample-application-expo.yml
File metadata and controls
238 lines (203 loc) · 7.73 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: Sample Application Expo
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
RN_SENTRY_POD_NAME: RNSentry
jobs:
ready-to-merge-gate:
name: Ready-to-merge gate
uses: ./.github/workflows/ready-to-merge-workflow.yml
with:
is-pr: ${{ github.event_name == 'pull_request' }}
labels: ${{ toJson(github.event.pull_request.labels) }}
diff_check:
needs: [ready-to-merge-gate]
uses: ./.github/workflows/skip-ci.yml
detect-changes:
needs: [ready-to-merge-gate]
uses: ./.github/workflows/detect-changes.yml
with:
caller_event_name: ${{ github.event_name }}
caller_ref: ${{ github.ref }}
build-ios:
name: Build ios ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }}
runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:10"]
needs: [diff_check, detect-changes]
if: >-
${{
needs.diff_check.outputs.skip_ci != 'true'
&& needs.detect-changes.outputs.needs_sample_expo == 'true'
&& (needs.detect-changes.outputs.sample_expo == 'true' || needs.detect-changes.outputs.needs_ios == 'true')
}}
env:
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
strategy:
fail-fast: false
matrix:
ios-use-frameworks: ['no-frameworks', 'dynamic-frameworks']
build-type: ['dev', 'production']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
package-manager-cache: false
node-version: 20
cache: 'yarn'
cache-dependency-path: yarn.lock
- uses: ruby/setup-ruby@v1
with:
working-directory: samples/expo
ruby-version: '3.3.0' # based on what is used in the sample
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 1 # cache the installed gems
- name: Setup Global Xcode Tools
run: which xcbeautify || brew install xcbeautify
- name: Install SDK Dependencies
run: yarn install
- name: Build SDK
run: yarn build
- name: Prebuild apps
working-directory: samples/expo
run: npx expo prebuild --platform ios
- name: Install App Pods
working-directory: samples/expo/ios
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic
echo "ENABLE_PROD=$ENABLE_PROD"
# Monorepo fix: Point Sentry SDK to correct React Native version (0.83 vs 0.80)
export REACT_NATIVE_NODE_MODULES_DIR="$(cd ../node_modules/react-native && pwd)"
PRODUCTION=$ENABLE_PROD pod install
cat Podfile.lock | grep $RN_SENTRY_POD_NAME
- name: Build iOS App
working-directory: samples/expo/ios
env:
# Fix for Xcode 26+ with MetalToolchain: use default Xcode toolchain to avoid
# missing Swift compatibility libraries (swiftCompatibility56, etc.)
# See: https://github.com/actions/runner-images/issues/13135
TOOLCHAINS: com.apple.dt.toolchain.XcodeDefault
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-workspace sentryreactnativeexposample.xcworkspace \
-configuration "$CONFIG" \
-scheme sentryreactnativeexposample \
-sdk 'iphonesimulator' \
-destination 'generic/platform=iOS Simulator' \
ONLY_ACTIVE_ARCH=yes \
ARCHS=arm64 \
-derivedDataPath "$derivedData" \
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Export Expo
working-directory: samples/expo
run: |
npx expo export -p ios
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: build-sample-expo-ios-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
path: samples/expo/ios/*.log
build-android:
name: Build android ${{ matrix.build-type }}
runs-on: ubuntu-latest
needs: [diff_check, detect-changes]
if: >-
${{
needs.diff_check.outputs.skip_ci != 'true'
&& needs.detect-changes.outputs.needs_sample_expo == 'true'
&& (needs.detect-changes.outputs.sample_expo == 'true' || needs.detect-changes.outputs.needs_android == 'true')
}}
env:
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
strategy:
fail-fast: false
matrix:
build-type: ['dev', 'production']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Enable Corepack (NPM)
run: npm i -g corepack
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
package-manager-cache: false
node-version: 20
cache: 'yarn'
cache-dependency-path: yarn.lock
- uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'adopt'
- name: Gradle cache
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
- name: Install SDK Dependencies
run: yarn install
- name: Build SDK
run: yarn build
- name: Prebuild apps
working-directory: samples/expo
run: npx expo prebuild --platform android
- name: Build Android App
working-directory: samples/expo/android
env:
# Increase memory for Expo SDK 55 lint tasks
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g"
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86
- name: Export Expo
working-directory: samples/expo
run: |
npx expo export -p android
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: build-sample-expo-android-${{ matrix.build-type }}-logs
path: samples/expo/android/*.log
build-web:
name: Build web
runs-on: ubuntu-latest
needs: [diff_check, detect-changes]
if: >-
${{
needs.diff_check.outputs.skip_ci != 'true'
&& needs.detect-changes.outputs.needs_sample_expo == 'true'
&& (needs.detect-changes.outputs.sample_expo == 'true' || needs.detect-changes.outputs.needs_web == 'true')
}}
env:
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Enable Corepack (NPM)
run: npm i -g corepack
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
package-manager-cache: false
node-version: 20
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Install SDK Dependencies
run: yarn install
- name: Build SDK
run: yarn build
- name: Build Web App
working-directory: samples/expo
run: |
npx expo export -p web