Skip to content

Commit 18288c7

Browse files
committed
ci: add action to build python wheels for many platforms
1 parent 9b7c1ae commit 18288c7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/python-wheels.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build Python wheels
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: 'v*'
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-python-wheels:
12+
name: Build wheels on ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
17+
python-version: ['cp310', 'cp311']
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
# Used to host cibuildwheel
23+
- uses: actions/setup-python@v3
24+
25+
- name: Install cibuildwheel
26+
run: python -m pip install cibuildwheel==2.16.5
27+
28+
- name: Install maturin
29+
run: python -m pip install maturin
30+
31+
- name: Build wheels
32+
run: python -m cibuildwheel --output-dir wheelhouse
33+
env:
34+
CIBW_BUILD: '${{ matrix.python-version }}-*'
35+
36+
- uses: actions/upload-artifact@v4
37+
with:
38+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
39+
path: ./wheelhouse/*.whl

0 commit comments

Comments
 (0)