Build Wheels Mac x86 #2
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: Build Wheels Mac x86 | |
on: | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# MacOS x86_64 | |
- os: macos-latest | |
python: '39' | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: '310' | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: '311' | |
platform_id: macosx_x86_64 | |
- os: macos-latest | |
python: '312' | |
platform_id: macosx_x86_64 | |
steps: | |
- name: Check out pdc-dp-means | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel | |
shell: bash | |
- name: Build wheels with cibuildwheel | |
uses: pypa/[email protected] | |
env: | |
CIBW_BEFORE_BUILD_LINUX: | | |
pip install -U cython | |
git clone https://github.com/scikit-learn/scikit-learn.git | |
cd scikit-learn | |
git checkout 1.2.X | |
python -m pip install -e . | |
cd .. | |
if [ ! -L sklearn ]; then | |
ln -s scikit-learn/sklearn . | |
fi | |
CIBW_BEFORE_BUILD_WINDOWS: >- | |
pip install -U cython && | |
git clone https://github.com/scikit-learn/scikit-learn.git && | |
cd scikit-learn && | |
git checkout 1.2.X && | |
python -m pip install -e . && | |
cd .. && | |
if not exist sklearn mklink /D sklearn scikit-learn\sklearn | |
CIBW_BEFORE_BUILD_MACOS: | | |
pip install -U cython | |
git clone https://github.com/scikit-learn/scikit-learn.git | |
cd scikit-learn | |
git checkout 1.2.X | |
python -m pip install -e . | |
cd .. | |
if [ ! -e sklearn ]; then | |
ln -s scikit-learn/sklearn . | |
fi | |
CIBW_TEST_REQUIRES: pytest numpy scikit-learn | |
CIBW_TEST_COMMAND: pytest {package}/tests | |
CIBW_ARCHS: auto | |
CIBW_ARCHS_MACOS: x86_64 | |
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} | |
CIBW_TEST_SKIP: "*-macosx_arm64" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse/*.whl | |
upload-to-pypi: | |
needs: build_wheels | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
- name: Publish to PyPI | |
uses: pypa/[email protected] | |
with: | |
packages-dir: dist | |
skip-existing: true |