name: Build and upload to PyPI env: # skip EOL interpreters CIBW_SKIP: "cp36-* cp37-* cp38-* pp*" on: workflow_dispatch: jobs: build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v3 - name: Build wheels uses: pypa/cibuildwheel@v2.16.2 - name: Upload wheels uses: actions/upload-artifact@v4 with: name: wheels-${{ matrix.os }} path: ./wheelhouse/*.whl build_sdist: name: Build source distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Build sdist run: pipx run build --sdist - name: Upload sdist uses: actions/upload-artifact@v4 with: name: sdist path: dist/*.tar.gz upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest steps: - name: Download all artifacts uses: actions/download-artifact@v4 with: path: dist merge-multiple: true - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 # stay on latest 1.x with: user: __token__ # default, but kept explicit password: ${{ secrets.PYPI_API_TOKEN }} # new secret verbose: true