fix(ci): add retry logic to VSCode IDE Companion publish steps (#6574)

* Initial plan

* fix(ci): add retry logic to VSCode IDE Companion publish steps

The publish step failed due to a request timeout when publishing the
universal VSIX to the VS Code Marketplace. Add retry logic (up to 3
attempts with 15s delay) to both the Microsoft Marketplace and OpenVSX
publish steps to handle transient network failures gracefully.

Closes #6550

* fix(ci): make OpenVSX publish retries idempotent

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: yiliang114 <effortyiliang@gmail.com>
This commit is contained in:
Copilot 2026-07-09 17:54:27 +08:00 committed by GitHub
parent e64010c116
commit f2885a09b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -314,7 +314,17 @@ jobs:
echo "Publishing to Microsoft Marketplace..."
for vsix in vsix-artifacts/*.vsix; do
echo "Publishing: ${vsix}"
vsce publish --packagePath "${vsix}" --pat "${VSCE_PAT}" --skip-duplicate
for attempt in 1 2 3; do
if vsce publish --packagePath "${vsix}" --pat "${VSCE_PAT}" --skip-duplicate; then
break
fi
if [[ ${attempt} -eq 3 ]]; then
echo "Failed to publish ${vsix} after 3 attempts"
exit 1
fi
echo "Attempt ${attempt} failed, retrying in 15s..."
sleep 15
done
done
- name: 'Publish to OpenVSX'
@ -325,11 +335,22 @@ jobs:
echo "Publishing to OpenVSX..."
for vsix in vsix-artifacts/*.vsix; do
echo "Publishing: ${vsix}"
if [[ "${{ needs.prepare.outputs.is_preview }}" == "true" ]]; then
ovsx publish "${vsix}" --pat "${OVSX_TOKEN}" --pre-release
else
ovsx publish "${vsix}" --pat "${OVSX_TOKEN}"
fi
for attempt in 1 2 3; do
if [[ "${{ needs.prepare.outputs.is_preview }}" == "true" ]]; then
publish_cmd=(ovsx publish "${vsix}" --pat "${OVSX_TOKEN}" --pre-release --skip-duplicate)
else
publish_cmd=(ovsx publish "${vsix}" --pat "${OVSX_TOKEN}" --skip-duplicate)
fi
if "${publish_cmd[@]}"; then
break
fi
if [[ ${attempt} -eq 3 ]]; then
echo "Failed to publish ${vsix} after 3 attempts"
exit 1
fi
echo "Attempt ${attempt} failed, retrying in 15s..."
sleep 15
done
done
- name: 'Upload all VSIXes as release artifacts (dry run)'