Build Wheels #67
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 | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, windows-2019, macos-13, macos-14] | |
python: [39, 310, 311, 312] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Set platform | |
id: platform | |
shell: bash | |
run: | | |
if [ ${{ runner.os }} = 'Linux' ]; then | |
echo "build_platform=manylinux" >> $GITHUB_OUTPUT | |
elif [ ${{ runner.os }} = 'macOS' ]; then | |
echo "build_platform=macosx" >> $GITHUB_OUTPUT | |
elif [ ${{ runner.os }} = 'Windows' ]; then | |
echo "build_platform=win_amd64" >> $GITHUB_OUTPUT | |
fi | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS: auto64 | |
CIBW_BUILD: cp${{ matrix.python }}-${{ steps.platform.outputs.build_platform }}* | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ runner.arch == 'ARM64' && '11.0' || '10.13' }} | |
CIBW_TEST_COMMAND: pytest --strict-markers -m 'not slow' -k 'not test_fit_and_predict_linear_regression' {project}/tests | |
CIBW_TEST_COMMAND_WINDOWS: pytest --strict-markers -m "not slow" -k "not test_fit_and_predict_linear_regression" {project}\\tests | |
CIBW_TEST_REQUIRES: pytest | |
# Skip trying to test arm64 builds on Intel Macs, and vice versa | |
CIBW_TEST_SKIP: "*-macosx_${{ runner.arch == 'ARM64' && 'x86_64' || 'arm64' }} *-macosx_universal2:arm64" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz |