Skip to content

chore: upgrade example to expo54 sdk with CNG #4

chore: upgrade example to expo54 sdk with CNG

chore: upgrade example to expo54 sdk with CNG #4

name: Verify Expo Prebuild
on:
pull_request:
paths:
- 'example/**'
- 'app.config.js'
- 'app.config.ts'
- 'app.json'
- 'package.json'
- '.github/workflows/verify-prebuild.yml'
jobs:
verify-prebuild:
name: Verify native folders match prebuild
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js and Dependencies
uses: ./.github/actions/setup-node-deps
- name: Run expo prebuild
working-directory: example
run: npx expo prebuild --clean --no-install
- name: Check for uncommitted changes
run: |
# Exclude files that expo prebuild regenerates with random/non-deterministic content:
# - Podfile.lock: CocoaPods lock file (helps CI caching)
# - .xcworkspace: Generated by CocoaPods
# - PrivacyInfo.xcprivacy: May vary by Expo SDK version
# - project.pbxproj: Expo generates new random UUIDs for assets on each prebuild
CHANGES=$(git status --porcelain example/android example/ios | \
grep -v 'example/ios/Podfile.lock' | \
grep -v 'example/ios/.*\.xcworkspace/' | \
grep -v 'example/ios/.*/PrivacyInfo.xcprivacy' | \
grep -v 'example/ios/.*\.xcodeproj/project.pbxproj' || true)
if [[ -n "$CHANGES" ]]; then
echo "❌ Error: Native folders don't match expo prebuild output"
echo ""
echo "This means either:"
echo "1. The native folders were manually modified (not allowed)"
echo "2. The app.config.js or plugins changed but native folders weren't updated"
echo ""
echo "To fix this:"
echo "1. Run 'cd example && npx expo prebuild --clean' locally"
echo "2. Commit the changes"
echo ""
echo "Note: Podfile.lock, .xcworkspace, PrivacyInfo.xcprivacy, and project.pbxproj are excluded"
echo "(Expo generates random UUIDs in project.pbxproj on each prebuild)"
echo ""
echo "═══════════════════════════════════════════════════════════"
echo "Changed files:"
echo "$CHANGES"
echo ""
echo "═══════════════════════════════════════════════════════════"
echo "Diff:"
# Only show diff for files that actually changed (from $CHANGES)
# This handles cases where android/ios folders may not exist
echo "$CHANGES" | while read status file; do
if [ -n "$file" ]; then
git --no-pager diff HEAD -- "$file" || true
fi
done
exit 1
else
echo "✅ Success: Native folders match expo prebuild output"
echo "(Excluding: Podfile.lock, .xcworkspace, PrivacyInfo.xcprivacy, project.pbxproj)"
fi