Skip to content

Commit 31e46f2

Browse files
committed
fix(ci): soften preview expo submit for per-platform credential gaps
1 parent 415e8c3 commit 31e46f2

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/promote-ui.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,32 @@ jobs:
632632
exit 1
633633
fi
634634
cd apps/ui
635-
npx --yes eas-cli@18.0.1 submit --platform "${{ inputs.expo_platform }}" --latest --non-interactive
635+
submit_platform() {
636+
local platform="$1"
637+
npx --yes eas-cli@18.0.1 submit --platform "${platform}" --latest --non-interactive
638+
}
639+
640+
if [ "${{ inputs.expo_platform }}" = "all" ]; then
641+
submit_failures=0
642+
for submit_platform_name in ios android; do
643+
if ! submit_platform "${submit_platform_name}"; then
644+
if [ "${{ inputs.environment }}" = "preview" ]; then
645+
echo "::warning::Expo submit failed for \${submit_platform_name} in preview; continuing so successful platform submissions are preserved."
646+
submit_failures=1
647+
continue
648+
fi
649+
echo "Expo submit failed for platform '\${submit_platform_name}' in production." >&2
650+
exit 1
651+
fi
652+
done
653+
654+
if [ "${submit_failures}" -eq 1 ]; then
655+
echo "Preview submission completed with one or more platform failures." >> "$GITHUB_STEP_SUMMARY"
656+
fi
657+
exit 0
658+
fi
659+
660+
submit_platform "${{ inputs.expo_platform }}"
636661
637662
- name: Promote source ref to deploy branch (web)
638663
if: inputs.deploy_web

scripts/release/release_orchestrator_preview.contract.test.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,11 @@ test('publish-github-release skips asset upload when rolling tag move is blocked
114114
'asset upload must be gated by rolling tag success when using rolling releases',
115115
);
116116
});
117+
118+
test('promote-ui native_submit handles preview platform credential gaps without aborting all submissions', async () => {
119+
const raw = await loadWorkflow('promote-ui.yml');
120+
assert.match(raw, /- name: Expo submit[\s\S]*?submit_platform\(\) \{/);
121+
assert.match(raw, /for submit_platform_name in ios android; do/);
122+
assert.match(raw, /if \[ "\$\{\{ inputs\.environment \}\}" = "preview" \]; then/);
123+
assert.match(raw, /::warning::Expo submit failed for/);
124+
});

0 commit comments

Comments
 (0)