Skip to content

Commit 88c9273

Browse files
fix(mobile): propagate EAS store build failures
- Continue checking both platforms after a build failure - Fail the workflow after recording the platform-specific error
1 parent a9437f3 commit 88c9273

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

‎.github/workflows/mobile-eas-production.yml‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,31 @@ jobs:
161161
# the queued run for a later merge cannot overtake them and lose its OTA.
162162
# After an errored build, retry via workflow_dispatch mode=build — pushes
163163
# won't re-trigger it until the app version changes.
164-
- name: Ensure store builds exist for the current app version
164+
- id: store_builds
165+
name: Ensure store builds exist for the current app version
165166
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
167+
continue-on-error: true
166168
working-directory: apps/mobile
167169
env:
168170
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
169171
run: |
172+
failed=0
170173
version="$(npx expo config --json --type public | jq -r '.version')"
171174
for platform in ios android; do
172-
latest="$(eas build:list --platform "$platform" --buildProfile production --limit 1 --json --non-interactive | jq -r '.[0].appVersion // "none"')"
175+
latest="$(eas build:list --platform "$platform" --build-profile production --limit 1 --json --non-interactive | jq -r '.[0].appVersion // "none"')"
173176
if [ "$latest" = "$version" ]; then
174177
echo "$platform: production build for $version already exists (or is in progress)"
175178
continue
176179
fi
177180
echo "$platform: latest production build is $latest, app.config.ts says $version — building"
178-
eas build --platform "$platform" --profile production --auto-submit --non-interactive
179-
echo ":building_construction: $platform: cut production build for $version (auto-submitted)" >> "$GITHUB_STEP_SUMMARY"
181+
if eas build --platform "$platform" --profile production --auto-submit --non-interactive; then
182+
echo ":building_construction: $platform: cut production build for $version (auto-submitted)" >> "$GITHUB_STEP_SUMMARY"
183+
else
184+
failed=1
185+
echo ":x: $platform: production build or submission failed for $version" >> "$GITHUB_STEP_SUMMARY"
186+
fi
180187
done
188+
exit "$failed"
181189
182190
- name: Publish fingerprint-gated OTA
183191
if: steps.expo-token.outputs.present == 'true' && github.event_name == 'push'
@@ -201,3 +209,7 @@ jobs:
201209
echo ":warning: $platform: no finished production build matches fingerprint \`$hash\` — OTA skipped; JS changes reach $platform only once a matching build ships" >> "$GITHUB_STEP_SUMMARY"
202210
fi
203211
done
212+
213+
- name: Propagate store build failure
214+
if: steps.store_builds.outcome == 'failure'
215+
run: exit 1

0 commit comments

Comments
 (0)