From 8a9f16dbe14daf6c0413edbb199e013dded376f1 Mon Sep 17 00:00:00 2001 From: Boris Bolliet Date: Sat, 28 Sep 2024 20:45:54 +0100 Subject: [PATCH] Update build_wheels.yml --- .github/workflows/build_wheels.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 7cfb2aa3..397f9ea2 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -136,13 +136,29 @@ jobs: - name: Upload distributions to PyPI run: | - ls + ls ls -R wheels-and-sdist-${{ matrix.os }}-${{ matrix.python-version }} mkdir -p wheelhouse dist - # mv wheels-and-sdist--${{ matrix.os }}-${{ matrix.python-version }}/wheelhouse/* wheelhouse/ - mv wheels-and-sdist-${{ matrix.os }}-${{ matrix.python-version }}/dist/* dist/ - twine upload wheelhouse/* dist/* - # twine upload dist/* + if [ -d "wheels-and-sdist-${{ matrix.os }}-${{ matrix.python-version }}/wheelhouse" ]; then + mv wheels-and-sdist-${{ matrix.os }}-${{ matrix.python-version }}/wheelhouse/* wheelhouse/ + fi + if [ -d "wheels-and-sdist-${{ matrix.os }}-${{ matrix.python-version }}/dist" ]; then + mv wheels-and-sdist-${{ matrix.os }}-${{ matrix.python-version }}/dist/* dist/ + fi + + if [ "$(ls -A wheelhouse)" ]; then + echo "Uploading wheels..." + twine upload wheelhouse/* + else + echo "No wheels to upload." + fi + + if [ "$(ls -A dist)" ]; then + echo "Uploading source distribution..." + twine upload dist/* + else + echo "No source distribution to upload." + fi env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}