fix(ci): purge stale generated sources before publish build

publish-play-store.yml caches android/build + intermediates with a
restore-keys prefix fallback. After the package rename, that fallback
restored a generated autolinking tree (ReactNativeApplicationEntryPoint.java)
referencing the OLD package ai.opencode.mobile.BuildConfig, so
compileReleaseJavaWithJavac failed. Delete generated + intermediates
before prebuild so they regenerate for cc.agentlabs.opencode.

Build.yml has no Gradle cache, which is why it built the new package fine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
engineer
2026-05-30 13:12:58 -07:00
parent b808ad114e
commit 67e4c1f379
2 changed files with 10 additions and 1 deletions

View File

@@ -63,6 +63,15 @@ jobs:
node -e "const f='app.json';const j=require('./'+f);j.expo.android=j.expo.android||{};j.expo.android.versionCode=${{ github.run_number }};require('fs').writeFileSync(f,JSON.stringify(j,null,2)+'\n')"
echo "versionCode now: $(node -p "require('./app.json').expo.android.versionCode")"
- name: Purge stale generated sources
# The Android build cache (restore-keys prefix fallback) can restore a
# generated autolinking tree from a previous package id. Gradle then
# reuses ReactNativeApplicationEntryPoint.java referencing the OLD
# package (ai.opencode.mobile.BuildConfig) and compileReleaseJavaWithJavac
# fails. Delete generated sources so prebuild + Gradle regenerate them
# for the current package (cc.agentlabs.opencode).
run: rm -rf android/app/build/generated android/build/generated android/app/build/intermediates
- name: Expo prebuild
run: npx expo prebuild --platform android --no-install