Skip to content

Commit 2c1c7f6

Browse files
committed
fix(ci): report why an Android cloud build failed
A failed EAS build printed only "Build failed" in the job log, with the actual Gradle error visible solely on expo.dev — which needs a login, so the CI log was useless for diagnosing anything.
1 parent 0407483 commit 2c1c7f6

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/android-apk-build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,20 @@ jobs:
5353
# took hours and routinely had to be cancelled.
5454
- name: Build Android APK
5555
run: |
56-
set -euo pipefail
56+
set -uo pipefail
5757
eas build --platform android --profile local --non-interactive --wait --json \
5858
> "$RUNNER_TEMP/build.json"
59+
rc=$?
60+
if [ $rc -ne 0 ]; then
61+
# A failed cloud build otherwise reports only "Build failed" here, with
62+
# the actual Gradle error visible solely on expo.dev. Print it.
63+
echo "::group::EAS build result"; cat "$RUNNER_TEMP/build.json" || true; echo "::endgroup::"
64+
echo "::group::Last Android build on EAS"
65+
eas build:list --platform android --limit 1 --non-interactive --json \
66+
| jq '.[0] | {id, status, error, createdAt}'
67+
echo "::endgroup::"
68+
exit $rc
69+
fi
5970
url=$(jq -r '.[0].artifacts.buildUrl // .[0].artifacts.applicationArchiveUrl' \
6071
"$RUNNER_TEMP/build.json")
6172
if [ -z "$url" ] || [ "$url" = "null" ]; then

0 commit comments

Comments
 (0)