From 60aed75901ca888199be72945360debf77f12696 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Fri, 16 Aug 2024 10:49:11 -0400 Subject: [PATCH] ci: Update cibuildwheel configuration and build source distribution --- .github/workflows/native.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 27364a7cc..5491a446c 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -330,9 +330,28 @@ jobs: cd .. + build-python-sdist: + name: Build source distribution + runs-on: ubuntu-latest + needs: [ rust-clippy, rust-doc, rust-tests, rustfst-python-bench, rustfst-python, python-doc ] + if: startsWith(github.ref, 'refs/tags/rustfst-v') + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build source distribution + run: pipx run build --sdist + + - name: Upload source distribution as artifact + uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + publish-python-wheels: name: Publish Python Wheels to PyPI - needs: [ rust-clippy, rust-doc, rust-tests, rustfst-python-bench, rustfst-python, python-doc ] + needs: [ build-python-sdist ] if: startsWith(github.ref, 'refs/tags/rustfst-v') strategy: @@ -365,10 +384,18 @@ jobs: # On an Linux Intel runner with qemu installed, build Intel and ARM wheels CIBW_ARCHS_LINUX: "auto" + - name: Upload wheels as artifacts + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + - name: Setup Python uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} - - name: Upload + - name: Upload sdist and wheels to PyPI run: | python -m pip install twine - python -m twine upload -u "__token__" -p ${{ secrets.PYPI_PASSWORD }} -r pypi --verbose wheelhouse/* + python -m twine upload -u "__token__" -p ${{ secrets.PYPI_PASSWORD }} -r pypi --verbose wheelhouse/* dist/*.tar.gz