From 84bd4ee0e5f2b8291c0475414cc3f311a818b047 Mon Sep 17 00:00:00 2001 From: Pieter Pas Date: Mon, 2 Dec 2024 20:34:41 +0100 Subject: [PATCH] [CI] build wheels macOS and Windows --- .github/workflows/wheel.yml | 8 +++++++- pyproject.toml | 3 +++ scripts/ci/pre-build-macos.py | 3 +++ scripts/ci/pre-build-windows.py | 3 +++ scripts/ci/py-build-cmake.toml | 2 ++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 83d714d193..676acb2e82 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -209,17 +209,23 @@ jobs: # will use its default cross-compilation settings for Windows on ARM64. # For macOS, we build universal wheels that work on both Intel and ARM macs. build-macos-windows: - if: false name: Build wheels for ${{ matrix.os }} needs: [build-sdist] runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-latest, windows-latest] + fail-fast: false steps: - name: Checkout uses: actions/checkout@v4 + - run: tar czf include-Xcode_15.4.tar.gz -C /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr include + - uses: actions/upload-artifact@v4 + with: + name: include-Xcode_15.4 + path: include-Xcode_15.4.tar.gz + - name: Download sdist uses: actions/download-artifact@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 5ffac8d6bb..f5de3bda63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,6 +113,9 @@ environment = { PY_BUILD_CMAKE_VERBOSE = "1" } test-command = "pytest {package}/python/test" test-extras = ["test"] +[tool.cibuildwheel.config-settings] +--local = "scripts/ci/py-build-cmake.toml" + [tool.cibuildwheel.macos] archs = ["universal2"] before-build = [ diff --git a/scripts/ci/pre-build-macos.py b/scripts/ci/pre-build-macos.py index ac46029b41..c5a5788c2f 100644 --- a/scripts/ci/pre-build-macos.py +++ b/scripts/ci/pre-build-macos.py @@ -70,6 +70,9 @@ print(profile) opts = dict(shell=True, check=True) +if not Path("recipes").exists(): + run(f"git clone https://github.com/tttapa/conan-recipes recipes", **opts) + run(f"conan remote add tttapa-conan-recipes recipes --force", **opts) for c in ("Debug", "Release"): run( "conan install . -pr:h ./cibw.profile --build=missing -s build_type=" + c, diff --git a/scripts/ci/pre-build-windows.py b/scripts/ci/pre-build-windows.py index 1a1a4c33ee..9bcbf2a1f7 100644 --- a/scripts/ci/pre-build-windows.py +++ b/scripts/ci/pre-build-windows.py @@ -71,6 +71,9 @@ print(profile) opts = dict(shell=True, check=True) +if not Path("recipes").exists(): + run(f"git clone https://github.com/tttapa/conan-recipes recipes", **opts) + run(f"conan remote add tttapa-conan-recipes recipes --force", **opts) for c in ("RelWithDebInfo", "Release"): run( "conan install . -pr:h ./cibw.profile --build=missing -s build_type=Release", diff --git a/scripts/ci/py-build-cmake.toml b/scripts/ci/py-build-cmake.toml index 2f9b2f682e..c068cc376f 100644 --- a/scripts/ci/py-build-cmake.toml +++ b/scripts/ci/py-build-cmake.toml @@ -28,4 +28,6 @@ CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO = "/INCREMENTAL:NO /DEBUG:FULL /OPT:REF ALPAQA_PYTHON_DEBUG_CONFIG = "RelWithDebInfo" [windows.cmake.10] install_config = "RelWithDebInfo" +preset = "conan-python-relwithdebinfo" build_presets = "conan-python-relwithdebinfo" +build_path="build/python-relwithdebinfo"