|
1 | | -name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI |
| 1 | +name: Build and publish to PyPI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | release: |
5 | 5 | types: [published] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - build-n-publish: |
9 | | - name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI |
| 8 | + build: |
| 9 | + name: Build wheels for all supported Python versions |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 |
|
12 | 12 | steps: |
13 | | - - uses: actions/checkout@master |
14 | | - - name: Set up Python 3.10 |
15 | | - uses: actions/setup-python@v3 |
16 | | - with: |
17 | | - python-version: "3.10" |
| 13 | + - uses: actions/checkout@v3 |
18 | 14 |
|
19 | | - - name: Install pypa/build |
20 | | - run: python -m pip install build --user |
| 15 | + - name: Set up Python (for pip/cibuildwheel) |
| 16 | + uses: actions/setup-python@v4 |
| 17 | + with: |
| 18 | + python-version: "3.10" |
21 | 19 |
|
22 | | - - name: Build a binary wheel and a source tarball |
23 | | - run: |
24 | | - python -m build --wheel --sdist --outdir dist/ |
| 20 | + - name: Install cibuildwheel |
| 21 | + run: python -m pip install cibuildwheel |
25 | 22 |
|
26 | | - - name: Publish distribution 📦 to PyPI |
27 | | - if: startsWith(github.ref, 'refs/tags') |
28 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
29 | | - with: |
30 | | - password: ${{ secrets.PYPI_API_TOKEN }} |
| 23 | + - name: Build wheels with cibuildwheel |
| 24 | + run: python -m cibuildwheel --output-dir dist |
| 25 | + env: |
| 26 | + CIBW_SKIP: "pp* cp27* cp36*" |
| 27 | + |
| 28 | + - name: Publish to PyPI |
| 29 | + if: startsWith(github.ref, 'refs/tags') |
| 30 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 31 | + with: |
| 32 | + password: ${{ secrets.PYPI_API_TOKEN }} |
0 commit comments