Skip to content

Commit 22aa230

Browse files
committed
ci(mobile-e2e): expose mavenLocal globally for the consumer Gradle build
The Publish step puts the clerk-android snapshot in ~/.m2/repository, but the quickstart's android build can't see it: `expo prebuild --clean` regenerates android/build.gradle from template without mavenLocal(), and adding mavenLocal to packages/expo/android/build.gradle only configures the library's own repository chain — not the consumer's. Drop a global init script in ~/.gradle/init.d/ so every Gradle invocation on the runner (prebuild plugin resolution + :app:assembleRelease) picks up mavenLocal. Scoped behind the same snapshot-mode condition so manual version-string dispatches and PR runs are unaffected.
1 parent 55704c2 commit 22aa230

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/mobile-e2e.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,37 @@ jobs:
202202
echo "Pinned @clerk/expo (snapshot mode):"
203203
grep -nE "clerkAndroid(Api|Ui)Version|mavenLocal" "$file" | head
204204
205+
- name: Expose mavenLocal to every Gradle build on the runner
206+
# `expo prebuild --clean` regenerates the quickstart's android/build.gradle
207+
# from template without mavenLocal(), so the consumer-side Gradle build
208+
# can't resolve the snapshot we just publishToMavenLocal'd. A global
209+
# init script injects mavenLocal() into every Gradle invocation on
210+
# this runner (both the prebuild's gradle-plugin resolution and the
211+
# final :app:assembleRelease).
212+
if: inputs.clerk_android_ref != '' && inputs.clerk_android_snapshot_suffix != ''
213+
run: |
214+
mkdir -p ~/.gradle/init.d
215+
cat > ~/.gradle/init.d/mavenLocal.gradle <<'EOG'
216+
allprojects {
217+
repositories {
218+
mavenLocal()
219+
}
220+
}
221+
settingsEvaluated { settings ->
222+
settings.pluginManagement {
223+
repositories {
224+
mavenLocal()
225+
}
226+
}
227+
settings.dependencyResolutionManagement {
228+
repositories {
229+
mavenLocal()
230+
}
231+
}
232+
}
233+
EOG
234+
echo "Wrote ~/.gradle/init.d/mavenLocal.gradle"
235+
205236
- name: Pin clerk-android Maven version (version-string mode)
206237
# When the caller passes a pre-published clerk-android version
207238
# (e.g. "1.0.17-SNAPSHOT" already on Maven Central / Sonatype staging),

0 commit comments

Comments
 (0)