Skip to content

Commit 96f2ff9

Browse files
authored
ci: retry PyPI install smoke test to tolerate index propagation (#437)
1 parent 1150586 commit 96f2ff9

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/publish_package.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ jobs:
2626

2727
- name: Extract version from tag
2828
id: get_version
29-
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
29+
run: |
30+
VERSION="${GITHUB_REF#refs/tags/}"
31+
VERSION="${VERSION#v}"
32+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
3033
3134
- name: Update version in pyproject.toml
3235
run: |
@@ -72,10 +75,22 @@ jobs:
7275

7376
- name: Extract version from tag
7477
id: get_version
75-
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
78+
run: |
79+
VERSION="${GITHUB_REF#refs/tags/}"
80+
VERSION="${VERSION#v}"
81+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
7682
7783
- name: Install Comfy CLI via pip and Test
78-
run: pip install comfy-cli==${{env.VERSION}}
84+
run: |
85+
# PyPI's index can lag behind a successful upload by a minute or
86+
# two, so retry before failing the job.
87+
for i in 1 2 3 4 5 6 7 8; do
88+
pip install --no-cache-dir "comfy-cli==${VERSION}" && exit 0
89+
echo "Attempt $i: package not yet available on PyPI, waiting 15s..."
90+
sleep 15
91+
done
92+
echo "::error::Failed to install comfy-cli==${VERSION} after 8 attempts"
93+
exit 1
7994
8095
- name: Test Comfy CLI Help
8196
run: comfy --help

0 commit comments

Comments
 (0)