|
| 1 | +name: Wheel builder |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + build_wheels: |
| 10 | + |
| 11 | + defaults: |
| 12 | + run: |
| 13 | + shell: bash -l {0} |
| 14 | + |
| 15 | + name: Build wheel ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} |
| 16 | + runs-on: ${{ matrix.buildplat[0] }} |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + buildplat: |
| 21 | + - [ubuntu-latest, manylinux_x86_64] |
| 22 | + - [macos-13, macosx_x86_64] |
| 23 | + - [macos-14, macosx_arm64] |
| 24 | + - [windows-latest, win_amd64] |
| 25 | + python: |
| 26 | + - ["3.11", "cp311"] |
| 27 | + - ["3.12", "cp312"] |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Check out #${{ inputs.project }} |
| 31 | + uses: actions/checkout@v4 |
| 32 | + |
| 33 | + - name: Set up Python ${{ matrix.python[0] }} |
| 34 | + uses: actions/setup-python@v5 |
| 35 | + with: |
| 36 | + python-version: ${{ matrix.python[0] }} |
| 37 | + |
| 38 | + - name: Build wheels for Linux |
| 39 | + if: runner.os == 'Linux' |
| 40 | + uses: pypa/cibuildwheel@v2.21.1 |
| 41 | + env: |
| 42 | + CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} |
| 43 | + CIBW_BEFORE_BUILD: yum install -y gsl-devel && pip install -e . |
| 44 | + with: |
| 45 | + output-dir: wheelhouse |
| 46 | + |
| 47 | + - name: Build wheels for macOS |
| 48 | + if: runner.os == 'macOS' |
| 49 | + uses: pypa/cibuildwheel@v2.21.1 |
| 50 | + env: |
| 51 | + CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} |
| 52 | + MACOSX_DEPLOYMENT_TARGET: 13.0 |
| 53 | + CIBW_BEFORE_BUILD: brew install gsl && pip install -e . |
| 54 | + with: |
| 55 | + output-dir: wheelhouse |
| 56 | + |
| 57 | + - name: Set up conda for Windows |
| 58 | + if: runner.os == 'Windows' |
| 59 | + uses: conda-incubator/setup-miniconda@v3 |
| 60 | + with: |
| 61 | + activate-environment: gsl |
| 62 | + auto-update-conda: true |
| 63 | + environment-file: environment.yml |
| 64 | + auto-activate-base: false |
| 65 | + |
| 66 | + - name: install gsl for Windows |
| 67 | + if: runner.os == 'Windows' |
| 68 | + run: | |
| 69 | + conda config --set always_yes yes --set changeps1 no |
| 70 | + conda install gsl |
| 71 | +
|
| 72 | + - name: Build wheels for Windows |
| 73 | + if: runner.os == 'Windows' |
| 74 | + uses: pypa/cibuildwheel@v2.21.1 |
| 75 | + env: |
| 76 | + CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} |
| 77 | + CONDA_PREFIX: ${{ env.CONDA_PREFIX }} |
| 78 | + with: |
| 79 | + output-dir: wheelhouse |
| 80 | + |
| 81 | + - uses: actions/upload-artifact@v4 |
| 82 | + with: |
| 83 | + name: ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} |
| 84 | + path: ./wheelhouse/*.whl |
0 commit comments