build-wheels.yaml (1845B)
1 name: build-wheels 2 3 on: 4 push: 5 branches: 6 - wheel 7 tags: 8 - '*' 9 workflow_dispatch: 10 11 concurrency: 12 group: build-wheels-${{ github.ref }} 13 cancel-in-progress: true 14 15 jobs: 16 build_wheels: 17 name: ${{ matrix.python-version }} 18 runs-on: ${{ matrix.os }} 19 strategy: 20 fail-fast: false 21 matrix: 22 os: [ubuntu-latest] 23 python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"] 24 25 steps: 26 - uses: actions/checkout@v4 27 28 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 29 # for a list of versions 30 - name: Build wheels 31 uses: pypa/cibuildwheel@v2.16.5 32 env: 33 CIBW_BUILD: "${{ matrix.python-version}}-* " 34 CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" 35 CIBW_BUILD_VERBOSITY: 3 36 37 - name: Display wheels 38 shell: bash 39 run: | 40 ls -lh ./wheelhouse/ 41 42 - uses: actions/upload-artifact@v4 43 with: 44 name: wheel-${{ matrix.python-version }} 45 path: ./wheelhouse/*.whl 46 47 - name: Publish wheels to PyPI 48 env: 49 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 50 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 51 shell: bash 52 run: | 53 python3 -m pip install --upgrade pip 54 python3 -m pip install wheel twine setuptools 55 56 twine upload ./wheelhouse/*.whl 57 58 - name: Build sdist 59 if: ${{ matrix.python-version == 'cp38' }} 60 shell: bash 61 run: | 62 python3 setup.py sdist 63 ls -l dist/* 64 65 - name: Publish sdist to PyPI 66 if: ${{ matrix.python-version == 'cp38' }} 67 env: 68 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 69 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 70 run: | 71 twine upload dist/*.tar.gz