Fix docs #67
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: publish | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.16.2 | |
- name: Build wheels for Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_SKIP: "pp* *i686* *musllinux*" | |
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" | |
CIBW_BEFORE_BUILD: pip install --verbose --editable . | |
- name: Build wheels for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_SKIP: "pp* *i686* *win32" | |
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" | |
CIBW_BEFORE_BUILD: pip install --verbose --editable . | |
- name: Build wheels for macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" | |
CIBW_SKIP: "pp* *i686*" | |
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" | |
CIBW_BEFORE_BUILD: pip install --verbose --editable . | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
upload_pypi: | |
needs: build_wheels | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
pip install twine | |
- name: Publish | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python -m build --sdist | |
twine upload dist/* |