Skip to content

Commit 6896dbd

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

File tree

2 files changed

+65
-4
lines changed

2 files changed

+65
-4
lines changed

.github/workflows/build-and-test.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Build and test
22

33
on:
4-
push:
5-
branches: [main]
6-
tags: 'v*'
7-
pull_request:
4+
# push:
5+
# branches: [main]
6+
# tags: 'v*'
7+
# pull_request:
88
workflow_dispatch:
99

1010
env:

.github/workflows/python-wheels.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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 }} with Python ${{ matrix.python-version }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest] #, windows-latest, macos-13, macos-14]
17+
python-version: ['3.10', '3.11']
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up rust
23+
uses: dtolnay/rust-toolchain@stable
24+
with:
25+
toolchain: stable
26+
27+
- run: rustup target add aarch64-apple-darwin
28+
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
29+
30+
- run: |
31+
rustup toolchain install stable-i686-pc-windows-msvc
32+
rustup target add i686-pc-windows-msvc
33+
if: matrix.os == 'windows'
34+
35+
- name: Check Rust versions
36+
run: |
37+
rustc --version
38+
which rustc
39+
cargo --version
40+
which cargo
41+
rustup --version
42+
which rustup
43+
44+
- name: Set up Python
45+
uses: actions/setup-python@v3
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
architecture: x64
49+
50+
- name: Install maturin
51+
run: python -m pip install maturin
52+
53+
- name: Build wheels
54+
run: |
55+
cd lakers-python
56+
maturin build --out wheelhouse
57+
58+
- uses: actions/upload-artifact@v4
59+
with:
60+
name: wheel-${{ matrix.os }}-${{ matrix.python-version }}
61+
path: ./lakers-python/wheelhouse/*.whl

0 commit comments

Comments
 (0)