Platform id #3
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: Publish sdist and wheels | |
| env: | |
| SOURCE_REF_TO_BUILD: main | |
| on: | |
| schedule: | |
| # 01:01 UTC every Monday and Thursday. | |
| - cron: "1 1 * * 1,4" | |
| pull_request: | |
| branches: | |
| - main | |
| - release/** | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: Which PyPI environment to upload to, if any | |
| required: true | |
| type: choice | |
| options: ["none", "testpypi", "pypi"] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_wheels: | |
| name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }} | |
| if: github.repository == 'scikit-learn/scikit-learn-release' | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Linux | |
| - os: ubuntu-latest | |
| python: 311 | |
| platform_id: manylinux_x86_64 | |
| - os: ubuntu-latest | |
| python: 312 | |
| platform_id: manylinux_x86_64 | |
| - os: ubuntu-latest | |
| python: 313 | |
| platform_id: manylinux_x86_64 | |
| - os: ubuntu-latest | |
| python: 314 | |
| platform_id: manylinux_x86_64 | |
| - os: ubuntu-latest | |
| python: 314t | |
| platform_id: manylinux_x86_64 | |
| # Linux arm | |
| - os: ubuntu-24.04-arm | |
| python: 311 | |
| platform_id: manylinux_aarch64 | |
| - os: ubuntu-24.04-arm | |
| python: 312 | |
| platform_id: manylinux_aarch64 | |
| - os: ubuntu-24.04-arm | |
| python: 313 | |
| platform_id: manylinux_aarch64 | |
| - os: ubuntu-24.04-arm | |
| python: 314 | |
| platform_id: manylinux_aarch64 | |
| - os: ubuntu-24.04-arm | |
| python: 314t | |
| platform_id: manylinux_aarch64 | |
| steps: | |
| - name: Checkout scikit-learn-release | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| persist-credentials: false | |
| - name: Checkout scikit-learn | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| repository: scikit-learn/scikit-learn | |
| ref: ${{ env.SOURCE_REF_TO_BUILD }} | |
| path: scikit-learn-src | |
| persist-credentials: false | |
| - name: Build and test wheels | |
| uses: pypa/cibuildwheel@f03ac7617d6cff873ccf24cc0d567ef5ba5a9e6d # v4.0.0 | |
| env: | |
| CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} | |
| CIBW_TEST_REQUIRES: ${{ contains(matrix.python, '314') && 'pytest' || 'pytest pandas' }} scipy | |
| CIBW_BEFORE_TEST_WINDOWS: bash tools/build_minimal_windows_image.sh ${{ matrix.python }} ${{matrix.platform_id}} | |
| CIBW_TEST_COMMAND_WINDOWS: bash {project}/tools/test_windows_wheels.sh ${{ matrix.python }} {project} ${{matrix.platform_id}} | |
| SRC: ${{ github.workspace }}/scikit-learn-src | |
| with: | |
| package-dir: scikit-learn-src | |
| output-dir: dist | |
| config-file: cibuildwheel.toml | |
| - name: Store artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: cibw-wheels-cp${{ matrix.python }}-${{ matrix.platform_id }} | |
| path: ./dist/*.whl |