Skip to content

Commit 8385ada

Browse files
committed
use ci build wheel for packages
1 parent 4a90d9a commit 8385ada

File tree

2 files changed

+75
-32
lines changed

2 files changed

+75
-32
lines changed

.github/workflows/publish-to-test.yaml

+74-31
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,84 @@ on:
66
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' # only run on alpha tags
77

88
jobs:
9-
build:
10-
name: Build distribution 📦
11-
runs-on: macos-latest
12-
9+
make_sdist:
10+
name: Make SDist
11+
runs-on: ubuntu-latest
1312
steps:
1413
- uses: actions/checkout@v4
1514

16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: "3.x"
20-
21-
- name: Install uv
22-
uses: astral-sh/setup-uv@v4
23-
24-
- name: Build
25-
env:
26-
CFLAGS: -I/opt/homebrew/include
27-
LDFLAGS: -L/opt/homebrew/lib
28-
run: |
29-
uv build --sdist
30-
uv build --wheel -p 3.9
31-
uv build --wheel -p 3.10
32-
uv build --wheel -p 3.11
33-
uv build --wheel -p 3.12
34-
uv build --wheel -p 3.13
35-
36-
- name: Store the distribution packages
37-
uses: actions/upload-artifact@v4
15+
- name: Build SDist
16+
run: pipx run build --sdist
17+
18+
- uses: actions/upload-artifact@v4
3819
with:
39-
name: python-package-distributions
40-
path: dist/
20+
name: cibw-sdist
21+
path: dist/*.tar.gz
22+
23+
build_wheels-manylinux:
24+
name: Build wheels on ubuntu-latest
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Build wheels
31+
uses: pypa/[email protected]
32+
env:
33+
CIBW_BEFORE_ALL_LINUX: >
34+
yum update &&
35+
yum install -y gmp-devel
36+
CIBW_BUILD: cp39-manylinux* cp310-manylinux* cp311-manylinux* cp312-manylinux* cp313-manylinux*
37+
CIBW_ENVIRONMENT_LINUX: CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
38+
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: cibw-wheels-manylinux
42+
path: ./wheelhouse/*.whl
43+
44+
# macos-13 is an intel runner
45+
build_wheels-macos-13:
46+
name: Build wheels on macos-13
47+
runs-on: macos-13
48+
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: Build wheels
53+
uses: pypa/[email protected]
54+
env:
55+
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-*
56+
CIBW_ENVIRONMENT_MACOS: CFLAGS="-I/opt/homebrew/include" LDFLAGS="-L/opt/homebrew/lib"
57+
MACOSX_DEPLOYMENT_TARGET: 13.0
58+
59+
- uses: actions/upload-artifact@v4
60+
with:
61+
name: cibw-wheels-macos-13
62+
path: ./wheelhouse/*.whl
63+
64+
# macos-14 is apple silicon
65+
build_wheels-macos-14:
66+
name: Build wheels on macos-14
67+
runs-on: macos-14
68+
69+
steps:
70+
- uses: actions/checkout@v4
71+
72+
- name: Build wheels
73+
uses: pypa/[email protected]
74+
env:
75+
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-*
76+
CIBW_ENVIRONMENT_MACOS: CFLAGS="-I/opt/homebrew/include" LDFLAGS="-L/opt/homebrew/lib"
77+
MACOSX_DEPLOYMENT_TARGET: 14.0
78+
79+
- uses: actions/upload-artifact@v4
80+
with:
81+
name: cibw-wheels-macos-14
82+
path: ./wheelhouse/*.whl
4183

4284
publish-to-testpypi:
4385
name: Publish Python 🐍 distribution 📦 to TestPyPI
44-
needs:
45-
- build
86+
needs: [make_sdist, build_wheels-manylinux, build_wheels-macos-13, build_wheels-macos-14]
4687
runs-on: ubuntu-latest
4788

4889
environment:
@@ -56,8 +97,10 @@ jobs:
5697
- name: Download all the dists
5798
uses: actions/download-artifact@v4
5899
with:
59-
name: python-package-distributions
100+
pattern: cibw-*
60101
path: dist/
102+
merge-multiple: true
103+
61104
- name: Publish distribution 📦 to TestPyPI
62105
uses: pypa/gh-action-pypi-publish@release/v1
63106
with:

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# The short X.Y version.
6565
version: str = "3.0"
6666
# The full version, including alpha/beta/rc tags.
67-
release: str = "3.0.0a0"
67+
release: str = "3.0.0a1"
6868

6969
# The language for content autogenerated by Sphinx. Refer to documentation
7070
# for a list of supported languages.

0 commit comments

Comments
 (0)