Repository navigation
refactor workflow triggers and conditions for clarity #7
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 Wheels | |
| on: | |
| push: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| build_wheels: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-2022] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install CUDA Toolkit | |
| uses: Jimver/cuda-toolkit@v0.2.21 | |
| with: | |
| cuda: '12.5.1' | |
| method: 'network' | |
| use-github-cache: 'true' | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.21.3 | |
| env: | |
| CIBW_ARCHS_WINDOWS: "AMD64" | |
| CIBW_SKIP: "cp36-* cp37-* cp38-* cp39-* pp*" | |
| CIBW_BUILD_VERBOSITY: 1 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels | |
| path: ./wheelhouse/*.whl | |
| publish_to_pypi: | |
| name: Publish to PyPI | |
| needs: [build_wheels] | |
| runs-on: ubuntu-latest | |
| environment: pypi-release | |
| permissions: | |
| id-token: write | |
| if: github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels | |
| path: dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |