ci: make bridge release publishing idempotent

This commit is contained in:
Haitao Pan 2026-05-02 18:35:27 +08:00
parent 93f16eac8f
commit 8e4c0a6dcf

View File

@ -263,12 +263,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release create "${{ steps.release_meta.outputs.tag }}" \
dist/service-image-ref.txt#xworkmate-bridge-service-image-ref.txt \
--repo "${{ github.repository }}" \
--target "${{ github.sha }}" \
--title "${{ steps.release_meta.outputs.title }}" \
--notes "Automated release for ${GITHUB_SHA}."
tag="${{ steps.release_meta.outputs.tag }}"
asset="dist/service-image-ref.txt#xworkmate-bridge-service-image-ref.txt"
if gh release view "${tag}" --repo "${{ github.repository }}" >/dev/null 2>&1; then
gh release upload "${tag}" "${asset}" \
--repo "${{ github.repository }}" \
--clobber
else
gh release create "${tag}" "${asset}" \
--repo "${{ github.repository }}" \
--target "${{ github.sha }}" \
--title "${{ steps.release_meta.outputs.title }}" \
--notes "Automated release for ${GITHUB_SHA}."
fi
validate:
name: Validate