Bunch of improvements #63
This file contains hidden or 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: Build Python Wheels | |
| on: | |
| pull_request: | |
| release: | |
| types: [created] | |
| jobs: | |
| build-linux: | |
| name: Build wheels on Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install cibuildwheel | |
| - name: Build wheels with cibuildwheel | |
| env: | |
| CIBW_ARCHS_LINUX: 'x86_64' | |
| CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | |
| CIBW_BEFORE_ALL_LINUX: | | |
| yum install -y epel-release && \ | |
| yum install -y \ | |
| libX11-devel \ | |
| libXcursor-devel \ | |
| libXrandr-devel \ | |
| libXinerama-devel \ | |
| libXi-devel \ | |
| wayland-devel \ | |
| libxkbcommon-devel \ | |
| mesa-libEGL-devel \ | |
| mesa-libGLES-devel | |
| run: cibuildwheel --output-dir dist | |
| - name: Upload Linux artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-linux | |
| path: dist | |
| build-macos: | |
| name: Build wheels on macOS | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install cibuildwheel | |
| - name: Build wheels with cibuildwheel | |
| run: cibuildwheel --output-dir dist | |
| - name: Upload macOS artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-macos | |
| path: dist | |
| publish: | |
| name: Publish to PyPI | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| needs: [build-linux, build-macos] | |
| environment: | |
| name: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download Linux wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-linux | |
| path: dist | |
| - name: Download macOS wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist-macos | |
| path: dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist |