Skip to content

Commit bd29f65

Browse files
radarherehugovk
andauthored
Count dists before uploading scientific wheels or publishing to PyPI (#139)
Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Andrew Murray <[email protected]>
1 parent 289a7fa commit bd29f65

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/wheels.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,27 @@ jobs:
251251
name: dist-sdist
252252
path: dist/*.tar.gz
253253

254+
count-dists:
255+
needs: [build-native-wheels, windows, sdist]
256+
runs-on: ubuntu-latest
257+
name: Count dists
258+
steps:
259+
- uses: actions/download-artifact@v5
260+
with:
261+
pattern: dist-*
262+
path: dist
263+
merge-multiple: true
264+
- name: "What did we get?"
265+
run: |
266+
ls -alR
267+
echo "Number of dists, should be $EXPECTED_DISTS:"
268+
files=$(ls dist 2>/dev/null | wc -l)
269+
echo $files
270+
[ "$files" -eq $EXPECTED_DISTS ] || exit 1
271+
254272
scientific-python-nightly-wheels-publish:
255273
if: github.repository_owner == 'python-pillow' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
256-
needs: [build-native-wheels, windows]
274+
needs: count-dists
257275
runs-on: ubuntu-latest
258276
name: Upload wheels to scientific-python-nightly-wheels
259277
steps:
@@ -270,7 +288,7 @@ jobs:
270288

271289
pypi-publish:
272290
if: github.repository_owner == 'python-pillow' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
273-
needs: [build-native-wheels, windows, sdist]
291+
needs: count-dists
274292
runs-on: ubuntu-latest
275293
name: Upload release to PyPI
276294
environment:

0 commit comments

Comments
 (0)