diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index b5db15e..513a80f 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -103,7 +103,6 @@ jobs: platform_id: macosx_x86_64 deployment_target: 13.0 - # MacOS ARM - os: macos-14 python: 310 @@ -138,12 +137,14 @@ jobs: - name: Checkout CPT uses: actions/checkout@v3 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' + - name: macOS OpenMP setup + if: runner.os == 'macOS' + run: bash CI/github/setup_macos_runner.sh - - name: Build and test wheels + - name: Build wheels + uses: pypa/cibuildwheel@v3.1.2 + with: + output-dir: wheelhouse env: CIBW_BEFORE_BUILD: "python -m pip install --upgrade pip" CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} @@ -157,8 +158,6 @@ jobs: CIBW_ENVIRONMENT_MACOS: ${{ format('MACOSX_DEPLOYMENT_TARGET={0}', matrix.deployment_target) }} CIBW_ENABLE: cpython-freethreading - run: bash CI/github/build_wheels.sh - - name: Store artifacts uses: actions/upload-artifact@v4 with: diff --git a/CI/github/build_wheels.sh b/CI/github/setup_macos_runner.sh old mode 100755 new mode 100644 similarity index 74% rename from CI/github/build_wheels.sh rename to CI/github/setup_macos_runner.sh index 695ddfa..cdc8da7 --- a/CI/github/build_wheels.sh +++ b/CI/github/setup_macos_runner.sh @@ -4,7 +4,7 @@ set -e set -x # OpenMP is not present on macOS by default -if [[ "$RUNNER_OS" == "macOS" ]]; then +if [[ "$RUNNER_OS" == "macOS" ]]; then # this if is useless, but better be safe echo "Installing Mac OS dependencies" brew_prefix=$(brew --prefix) brew install libomp @@ -15,7 +15,3 @@ if [[ "$RUNNER_OS" == "macOS" ]]; then export CXXFLAGS="$CXXFLAGS -I$brew_prefix/opt/libomp/include" export LDFLAGS="$LDFLAGS -Wl,-rpath,$brew_prefix/opt/libomp/lib -L$brew_prefix/opt/libomp/lib -lomp" fi - -python -m pip install cibuildwheel==3.1.1 -python -m cibuildwheel --print-build-identifiers -python -m cibuildwheel --output-dir wheelhouse