Skip to content

Commit e65d89b

Browse files
committed
Update CI
1 parent 7689c5e commit e65d89b

File tree

2 files changed

+77
-19
lines changed

2 files changed

+77
-19
lines changed

.github/workflows/wheels.yml

Lines changed: 72 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,33 @@ jobs:
2929
path: dist/*.tar.gz
3030

3131
build_wheels:
32-
name: Build ${{ matrix.cpversion }} wheels on ${{ matrix.os }}
32+
name: Build wheels on ${{ matrix.os }}-${{ matrix.arch }}
3333
runs-on: ${{ matrix.os }}
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
38-
# cp313 seemed to produce the same wheel name as cp312. Skip unless
39-
# necessary.
40-
cpversion: [cp38, cp39, cp310, cp311, cp312]
41-
# github actions cp38 on macos-14 runners are cross compiling or
42-
# something and confusing the stub generation. Just skip it for now.
43-
# Maybe it'd be friendlier to disable the stub generation for this
44-
# combination.
45-
exclude:
46-
- os: macos-14
47-
cpversion: cp38
48-
49-
37+
include:
38+
- os: ubuntu-latest
39+
pybuilds: cp3{9,10,11,12}-manylinux_x86_64
40+
arch: x86_64
41+
id: linux_x86_64
42+
- os: ubuntu-24.04-arm
43+
pybuilds: cp3{9,10,11,12}-manylinux_aarch64
44+
arch: aarch64
45+
id: linux_arm64
46+
- os: macos-13
47+
pybuilds: cp3{9,10,11,12}-macosx_x86_64
48+
arch: x86_64
49+
id: macos_x86
50+
- os: macos-15
51+
pybuilds: cp3{9,10,11,12}-macosx_arm64
52+
arch: arm64
53+
id: macos_arm64
54+
- os: windows-latest
55+
pybuilds: cp3{9,10,11,12}-win_amd64
56+
arch: x86_64
57+
id: windows_amd64
58+
5059
steps:
5160
- uses: actions/checkout@v4
5261

@@ -60,13 +69,57 @@ jobs:
6069
- name: Build wheels
6170
# why do I need to specify this cpversion here?
6271
env:
63-
CIBW_ARCHS: "auto64"
64-
CIBW_BUILD: "${{ matrix.cpversion }}-*"
65-
# why isn't auto64 working?
72+
CIBW_BUILD: ${{ matrix.pybuilds }}
6673
CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32"
6774
run: python -m cibuildwheel --output-dir wheelhouse
6875

6976
- uses: actions/upload-artifact@v4
77+
name: Upload repaired wheels as artifact
7078
with:
71-
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
72-
path: ./wheelhouse/*.whl
79+
name: ${{ matrix.os }}-${{ strategy.job-index }}}-${{ matrix.arch }}
80+
path: |
81+
${{ steps.attest.outputs.bundle-path }}
82+
./wheelhouse/*.whl
83+
./wheelhouse/*.so
84+
./wheelhouse/*.dylib
85+
./wheelhouse/*.lib
86+
./wheelhouse/*.dll
87+
88+
release_artifacts:
89+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
90+
name: Release repaired and tested wheels
91+
needs: build_wheels
92+
runs-on: ubuntu-latest
93+
environment: release
94+
permissions:
95+
# IMPORTANT: this permission is mandatory for trusted publishing
96+
id-token: write
97+
contents: write
98+
99+
steps:
100+
- uses: actions/checkout@v4
101+
with:
102+
fetch-depth: 0 # Optional, use if you use setuptools_scm
103+
submodules: true # Optional, use if you have submodules
104+
105+
- name: Download compressed artifacts
106+
id: download
107+
uses: actions/download-artifact@v4
108+
with:
109+
path: ./artifacts
110+
merge-multiple: true
111+
112+
- name: Display structure of downloaded files
113+
run: ls -R ./artifacts
114+
115+
- name: Create release and upload wheels
116+
uses: ncipollo/release-action@v1
117+
with:
118+
allowUpdates: true
119+
artifacts: "${{ steps.download.outputs.download-path }}/*.whl,${{ steps.download.outputs.download-path }}/*.gz,${{ steps.download.outputs.download-path }}/*.so,${{ steps.download.outputs.download-path }}/*.dylib,${{ steps.download.outputs.download-path }}/*.lib,${{ steps.download.outputs.download-path }}/*.dll"
120+
token: ${{ secrets.GITHUB_TOKEN }}
121+
122+
- name: PyPI Publish
123+
uses: pypa/[email protected]
124+
with:
125+
packages-dir: ${{ steps.download.outputs.download-path }}

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,18 @@ wheel.py-api = "cp312"
4646
build-type = "Release"
4747

4848
[tool.cibuildwheel]
49+
archs = "auto64"
4950
# Necessary to see build output from the actual compilation
5051
build-verbosity = 1
5152

5253
# Run pytest to ensure that the package was correctly built
5354
test-command = "pytest {project}/tests"
5455
test-requires = "pytest"
5556

57+
# linux images
58+
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64"
59+
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64"
60+
5661
# Don't test Python 3.8 wheels on macOS/arm64
5762
test-skip="cp38-macosx_*:arm64"
5863

0 commit comments

Comments
 (0)