Queue publish runs and retry PyPI upload failures (#829)
This commit is contained in:
@@ -13,6 +13,10 @@ on:
|
|||||||
type: boolean
|
type: boolean
|
||||||
description: Publish to PyPI
|
description: Publish to PyPI
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}
|
||||||
|
queue: max
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
if: github.repository == 'ultralytics/actions' && github.actor == 'glenn-jocher' && github.ref == 'refs/heads/main'
|
if: github.repository == 'ultralytics/actions' && github.actor == 'glenn-jocher' && github.ref == 'refs/heads/main'
|
||||||
@@ -100,8 +104,20 @@ jobs:
|
|||||||
name: dist
|
name: dist
|
||||||
path: dist/
|
path: dist/
|
||||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
id: publish
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
skip-existing: true # tolerate recovery re-runs after partial failures
|
skip-existing: true # tolerate recovery re-runs after partial failures
|
||||||
|
- name: Clean partial attestations # leftover *.publish.attestation files make the retry fail pre-existence checks
|
||||||
|
if: steps.publish.outcome == 'failure'
|
||||||
|
run: |
|
||||||
|
rm -f dist/*.publish.attestation
|
||||||
|
sleep 30
|
||||||
|
- name: Retry publish # transient sigstore/Rekor or PyPI network failures
|
||||||
|
if: steps.publish.outcome == 'failure'
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
skip-existing: true
|
||||||
|
|
||||||
sbom:
|
sbom:
|
||||||
needs: [check, build, publish]
|
needs: [check, build, publish]
|
||||||
|
|||||||
Reference in New Issue
Block a user