Skip to content

Commit 7765073

Browse files
committed
[CI] Use cibuildwheel
1 parent 39902a0 commit 7765073

1 file changed

Lines changed: 62 additions & 14 deletions

File tree

.github/workflows/wheel.yml

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,51 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
wheel:
7+
build:
88
strategy:
9-
max-parallel: 2
9+
max-parallel: 4
1010
# let some wheels complete even if others fail
1111
fail-fast: false
1212
matrix:
13+
os: [ubuntu-latest]
14+
#os: [ubuntu-latest, windows-latest, macos-14, macos-15-intel]
15+
#python_version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1316
python_version: ['3.9']
14-
runs-on: ubuntu-latest
17+
18+
include:
19+
20+
- os: ubuntu-latest
21+
platform_id: manylinux_x86_64
22+
manylinux_image: manylinux2014
23+
- os: windows-latest
24+
platform_id: win_amd64
25+
# macos x86_64 (intel)
26+
- os: macos-15-intel
27+
platform_id: macosx_x86_64
28+
# macos arm64 (apple silicon)
29+
- os: macos-14
30+
platform_id: macosx_arm64
31+
32+
- python_version: '3.8'
33+
python: 38
34+
cibuildwheel: "cibuildwheel<3"
35+
- python_version: '3.9'
36+
python: 39
37+
cibuildwheel: "cibuildwheel<3"
38+
- python_version: '3.10'
39+
python: 310
40+
cibuildwheel: "cibuildwheel<3"
41+
- python_version: '3.11'
42+
python: 311
43+
cibuildwheel: "cibuildwheel<4"
44+
- python_version: '3.12'
45+
python: 312
46+
cibuildwheel: "cibuildwheel<4"
47+
- python_version: '3.13'
48+
python: 313
49+
cibuildwheel: "cibuildwheel<4"
50+
51+
runs-on: ${{ matrix.os }}
1552

1653
steps:
1754
- uses: actions/checkout@v4
@@ -20,17 +57,28 @@ jobs:
2057
uses: actions/setup-python@v5
2158
with:
2259
python-version: ${{ matrix.python_version }}
23-
architecture: x64
2460

25-
- name: Build Python package
26-
run: python setup.py bdist_wheel
61+
- name: Installation
62+
run:
63+
|
64+
python -m pip install --upgrade pip
65+
pip install "cython<3.0"
66+
pip install "numpy<2"
67+
pip install -e .
68+
69+
- name: Install cibuildwheel
70+
run: python -m pip install "${{ matrix.cibuildwheel }}"
2771

28-
- name: Inspect
29-
run: |
30-
find dist/
72+
- name: Build wheels
73+
run: python -m cibuildwheel --output-dir wheelhouse
74+
env:
75+
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
76+
CIBW_ARCHS: all
77+
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
78+
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
3179

32-
#- name: Upload a Build Artifact
33-
# uses: actions/upload-artifact@v4
34-
# with:
35-
# name: python_javabridge-2.4.4-cp39-cp39-manylinux-x86_64.whl
36-
# path: dist/
80+
- name: Store artifacts
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: cibw-wheels-cp${{ matrix.python }}-${{ matrix.platform_id }}
84+
path: ./wheelhouse/*.whl

0 commit comments

Comments
 (0)