6
6
pull_request :
7
7
branches :
8
8
- beta
9
+ merge_group :
10
+ types :
11
+ - checks_requested
12
+
13
+ env :
14
+ NODE_OPTIONS : --experimental-vm-modules
9
15
10
16
jobs :
11
17
lint :
18
24
uses : ./.github/actions/setup
19
25
20
26
- name : Lint files
21
- run : yarn lint './**/*.{ts,tsx,js,jsx}' --ignore-pattern node_modules
27
+ run : yarn lint
22
28
23
29
- name : Typecheck files
24
30
run : yarn typecheck
@@ -50,141 +56,37 @@ jobs:
50
56
- name : Setup
51
57
uses : ./.github/actions/setup
52
58
59
+ - name : Install missing dependencies
60
+ run : yarn add -D @ark/schema || echo "Package already installed or not needed"
61
+
53
62
- name : Build package
54
- run : yarn prepack
63
+ run : yarn prepare
55
64
56
- build-android :
65
+ build-web :
57
66
runs-on : ubuntu-latest
58
- env :
59
- TURBO_CACHE_DIR : .turbo/android
60
- ANDROID_HOME : /usr/local/lib/android/sdk
61
- JAVA_HOME : /usr/lib/jvm/zulu-17-amd64
62
- steps :
63
- - name : Checkout
64
- uses : actions/checkout@v4
65
-
66
- - name : Setup
67
- uses : ./.github/actions/setup
68
-
69
- - name : Cache turborepo for Android
70
- uses : actions/cache@v4
71
- with :
72
- path : ${{ env.TURBO_CACHE_DIR }}
73
- key : ${{ runner.os }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
74
- restore-keys : |
75
- ${{ runner.os }}-turborepo-android-
76
-
77
- - name : Check turborepo cache for Android
78
- run : |
79
- TURBO_CACHE_STATUS=$(node -p "($(yarn --silent turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
80
-
81
- if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
82
- echo "turbo_cache_hit=1" >> $GITHUB_ENV
83
- fi
84
-
85
- - name : Install JDK
86
- if : env.turbo_cache_hit != 1
87
- uses : actions/setup-java@v4
88
- with :
89
- distribution : ' zulu'
90
- java-version : ' 17'
91
-
92
- - name : Set up Android SDK
93
- if : env.turbo_cache_hit != 1
94
- uses : android-actions/setup-android@v2
95
- with :
96
- api-level : 30
97
- build-tools : 30.0.3
98
- ndk : " 23.1.7779620"
99
-
100
- - name : Create local.properties
101
- if : env.turbo_cache_hit != 1
102
- run : |
103
- echo "sdk.dir=$ANDROID_HOME" > example/android/local.properties
104
-
105
- - name : Finalize Android SDK
106
- if : env.turbo_cache_hit != 1
107
- run : |
108
- /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
109
-
110
- - name : Cache Gradle
111
- if : env.turbo_cache_hit != 1
112
- uses : actions/cache@v4
113
- with :
114
- path : |
115
- ~/.gradle/wrapper
116
- ~/.gradle/caches
117
- key : ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
118
- restore-keys : |
119
- ${{ runner.os }}-gradle-
120
-
121
- - name : Build example for Android
122
- run : |
123
- yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
124
-
125
- build-ios :
126
- runs-on : macos-latest
127
- env :
128
- TURBO_CACHE_DIR : .turbo/ios
129
67
steps :
130
68
- name : Checkout
131
69
uses : actions/checkout@v4
132
70
133
71
- name : Setup
134
72
uses : ./.github/actions/setup
135
73
136
- - name : Cache turborepo for iOS
137
- uses : actions/cache@v4
138
- with :
139
- path : ${{ env.TURBO_CACHE_DIR }}
140
- key : ${{ runner.os }}-turborepo-ios-${{ hashFiles('**/yarn.lock') }}
141
- restore-keys : |
142
- ${{ runner.os }}-turborepo-ios-
74
+ - name : Prepare library
75
+ run : yarn prepare
143
76
144
- - name : Check turborepo cache for iOS
77
+ - name : Build example for Web
145
78
run : |
146
- TURBO_CACHE_STATUS=$(node -p "($(yarn --silent turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
147
-
148
- if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
149
- echo "turbo_cache_hit=1" >> $GITHUB_ENV
150
- fi
151
-
152
- - name : Cache cocoapods
153
- if : env.turbo_cache_hit != 1
154
- id : cocoapods-cache
155
- uses : actions/cache@v4
156
- with :
157
- path : |
158
- **/ios/Pods
159
- key : ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
160
- restore-keys : |
161
- ${{ runner.os }}-cocoapods-
162
-
163
- - name : Install cocoapods
164
- if : env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
165
- run : |
166
- yarn example pods
167
- env :
168
- NO_FLIPPER : 1
169
-
170
- - name : Build example for iOS
171
- run : |
172
- yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" 2>&1 | grep -i error > ios_errorlog.txt
173
-
174
- - name : Upload iOS error log
175
- uses : actions/upload-artifact@v4
176
- with :
177
- name : ios-error-log
178
- path : ios_errorlog.txt
79
+ yarn example expo export --platform web
179
80
180
81
publish-beta :
181
- needs : [lint, test, build-library, build-android, build-ios ]
82
+ needs : [lint, test, build-library, build-web ]
182
83
runs-on : ubuntu-latest
183
84
permissions :
184
85
contents : write # To publish a GitHub release
185
86
issues : write # To comment on released issues
186
87
pull-requests : write # To comment on released pull requests
187
88
id-token : write # To enable use of OIDC for npm provenance
89
+ if : github.ref == 'refs/heads/beta'
188
90
steps :
189
91
- name : Checkout
190
92
uses : actions/checkout@v4
@@ -210,3 +112,4 @@ jobs:
210
112
211
113
# Why NODE_AUTH_TOKEN instead of NPM_TOKEN: https://github.com/semantic-release/semantic-release/issues/2313
212
114
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }} # npm token for publishing package
115
+
0 commit comments