Skip to content

Commit

Permalink
ci: Update cibuildwheel configuration and build source distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Aug 16, 2024
1 parent f69ec36 commit 60aed75
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 60aed75

Please sign in to comment.