build sdist + upload to twine #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build wheels | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build_wheels: | |
name: Build wheels for ${{ matrix.platforms[1] }} with Python ${{ matrix.python }} | |
runs-on: ${{ matrix.platforms[0] }} | |
strategy: | |
matrix: | |
platforms: | |
- [ubuntu-20.04, manylinux_x86_64] | |
- [ubuntu-20.04, musllinux_x86_64] | |
- [macos-13, macosx_x86_64] | |
- [macos-14, macosx_arm64] | |
- [windows-2019, win_amd64] | |
- [windows-2019, win32] | |
python: ["cp39", "cp310", "cp311", "cp312"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.18.1 | |
env: | |
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platforms[1] }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.python }}-${{ matrix.platforms[1] }} | |
path: ./wheelhouse/*.whl | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install twine | |
- name: Upload wheels to PyPI | |
run: | | |
python -m twine upload --repository testpypi wheelhouse/*.whl | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build twine | |
- name: Build source distribution | |
run: python3 -m build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: ./dist/*.tar.gz | |
- name: Upload source distribution to PyPI | |
run: | | |
python -m twine upload --repository testpypi dist/*.tar.gz | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} |