Skip to content

Commit 8615795

Browse files
committed
fix workflow
1 parent 034798e commit 8615795

1 file changed

Lines changed: 27 additions & 52 deletions

File tree

.github/workflows/build-wheels.yml

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,34 @@ on:
1010

1111
jobs:
1212
build_wheels:
13-
name: Build wheels on ${{ matrix.os }}
13+
name: Build wheels on ${{ matrix.os }} - Python ${{ matrix.python-version }}
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
os: [ubuntu-latest, windows-latest, macos-latest]
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1819

1920
steps:
2021
- uses: actions/checkout@v4
2122

2223
- name: Set up Python
24+
id: setup-python
2325
uses: actions/setup-python@v4
2426
with:
25-
python-version: '3.11'
27+
python-version: ${{ matrix.python-version }}
2628

27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
pip install cibuildwheel
29+
- name: Install Poetry
30+
uses: snok/install-poetry@v1
31+
with:
32+
virtualenvs-create: true
33+
virtualenvs-in-project: true
34+
35+
- name: Load cached venv
36+
id: cached-pip-wheels
37+
uses: actions/cache@v3
38+
with:
39+
path: ~/.cache
40+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
3141

3242
# Ubuntu: Install CGAL and dependencies
3343
- name: Install CGAL on Ubuntu
@@ -63,61 +73,26 @@ jobs:
6373
vcpkg integrate install
6474
vcpkg install cgal:x64-windows eigen3:x64-windows gmp:x64-windows mpfr:x64-windows
6575
76+
- name: Install dependencies
77+
run: poetry install --no-interaction --no-root
78+
6679
- name: Set dynamic version
6780
run: |
6881
echo "DYNAMIC_VERSION=0.1.0+dev.$(git rev-parse --short HEAD)" >> $GITHUB_ENV
6982
shell: bash
7083

71-
- name: Build wheels
84+
- name: Poetry build wheel
7285
env:
73-
# Configure cibuildwheel
74-
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
75-
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
76-
77-
# Set dynamic version for build
78-
CIBW_ENVIRONMENT: "CGAL_ALPHA_WRAPPING_VERSION=${{ env.DYNAMIC_VERSION }}"
79-
80-
# Linux environment
81-
CIBW_BEFORE_BUILD_LINUX: |
82-
yum install -y epel-release &&
83-
yum install -y cgal-devel eigen3-devel gmp-devel mpfr-devel gcc-c++ ||
84-
(apt-get update && apt-get install -y libcgal-dev libeigen3-dev libgmp-dev libmpfr-dev build-essential)
85-
86-
# macOS environment
87-
CIBW_BEFORE_BUILD_MACOS: |
88-
brew install cgal eigen gmp mpfr || true
89-
90-
# Windows environment
91-
CIBW_BEFORE_BUILD_WINDOWS: |
92-
if not exist "C:\vcpkg" (
93-
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg &&
94-
cd C:\vcpkg &&
95-
.\bootstrap-vcpkg.bat &&
96-
.\vcpkg integrate install &&
97-
.\vcpkg install cgal:x64-windows eigen3:x64-windows gmp:x64-windows mpfr:x64-windows
98-
)
99-
100-
# Environment variables for Windows builds
101-
CIBW_ENVIRONMENT_WINDOWS: >
102-
VCPKG_ROOT="C:\vcpkg"
103-
CMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake"
104-
105-
# Repair wheels (especially important for Linux)
106-
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair -w {dest_dir} {wheel}"
107-
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
108-
109-
# Test command to verify wheels work
110-
CIBW_TEST_COMMAND: "python -c 'import cgal_alpha_wrapping; print(cgal_alpha_wrapping.__name__)'"
111-
112-
# Build settings
113-
CIBW_BUILD_VERBOSITY: 1
114-
115-
run: python -m cibuildwheel --output-dir wheelhouse
86+
CGAL_ALPHA_WRAPPING_VERSION: ${{ env.DYNAMIC_VERSION }}
87+
run: |
88+
mkdir -p wheelhouse
89+
poetry build --format wheel
90+
cp dist/*.whl wheelhouse/
11691
11792
- name: Upload wheels
11893
uses: actions/upload-artifact@v4
11994
with:
120-
name: wheels-${{ matrix.os }}
95+
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }}
12196
path: ./wheelhouse/*.whl
12297

12398
build_sdist:

0 commit comments

Comments
 (0)