diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 655e715..99ca0bf 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -7,24 +7,36 @@ jobs: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: - matrix: - os: [ubuntu-20.04, windows-2019, macOS-11] + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v4 - # Used to host cibuildwheel - - uses: actions/setup-python@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.16.2 + run: | + python -m pip install --upgrade pip + pip install cibuildwheel - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - # to supply options, put them in 'env', like: - # env: - # CIBW_SOME_OPTION: value - uses: actions/upload-artifact@v3 with: - path: ./wheelhouse/*.whl \ No newline at end of file + path: ./wheelhouse/*.whl + + - name: Publish Wheels + if: startsWith(github.ref, 'refs/tags/') + run: | + pip install twine + python -m twine upload wheelhouse/*.whl + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} +