Skip to content

Commit e701bc8

Browse files
committed
ci: Update cibuildwheel configuration and build source distribution
1 parent b9d0e65 commit e701bc8

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

.github/workflows/native.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,28 @@ jobs:
330330
cd ..
331331
332332
333+
build-python-sdist:
334+
name: Build source distribution
335+
runs-on: ubuntu-latest
336+
needs: [ rust-clippy, rust-doc, rust-tests, rustfst-python-bench, rustfst-python, python-doc ]
337+
if: startsWith(github.ref, 'refs/tags/rustfst-v')
338+
steps:
339+
- name: Checkout
340+
uses: actions/checkout@v4
341+
342+
- name: Build source distribution
343+
run: pipx run build --sdist
344+
345+
- name: Upload source distribution as artifact
346+
uses: actions/upload-artifact@v4
347+
with:
348+
name: cibw-sdist
349+
path: dist/*.tar.gz
350+
351+
333352
publish-python-wheels:
334353
name: Publish Python Wheels to PyPI
335-
needs: [ rust-clippy, rust-doc, rust-tests, rustfst-python-bench, rustfst-python, python-doc ]
354+
needs: [ build-python-sdist ]
336355
if: startsWith(github.ref, 'refs/tags/rustfst-v')
337356

338357
strategy:
@@ -365,10 +384,18 @@ jobs:
365384
# On an Linux Intel runner with qemu installed, build Intel and ARM wheels
366385
CIBW_ARCHS_LINUX: "auto"
367386

387+
- name: Upload wheels as artifacts
388+
uses: actions/upload-artifact@v4
389+
with:
390+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
391+
path: ./wheelhouse/*.whl
392+
368393
- name: Setup Python
369394
uses: actions/setup-python@v5
395+
with:
396+
python-version: ${{ env.PYTHON_VERSION }}
370397

371-
- name: Upload
398+
- name: Upload sdist and wheels to PyPI
372399
run: |
373400
python -m pip install twine
374-
python -m twine upload -u "__token__" -p ${{ secrets.PYPI_PASSWORD }} -r pypi --verbose wheelhouse/*
401+
python -m twine upload -u "__token__" -p ${{ secrets.PYPI_PASSWORD }} -r pypi --verbose wheelhouse/* dist/*.tar.gz

0 commit comments

Comments
 (0)