Skip to content

Commit c4167ca

Browse files
authored
Merge pull request #253 from johnnynunez/main
Updated CI
2 parents 7689c5e + ec0412e commit c4167ca

File tree

3 files changed

+64
-43
lines changed

3 files changed

+64
-43
lines changed

.github/workflows/pip.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
platform: [windows-latest, macos-latest, ubuntu-latest]
17+
platform: [windows-latest, macos-latest, ubuntu-latest, ubuntu-24.04-arm]
1818
python-version: ["3.10"]
1919

2020
steps:

.github/workflows/wheels.yml

+58-42
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,79 @@ on:
1010

1111
jobs:
1212
build_sdist:
13-
name: Build SDist
1413
runs-on: ubuntu-latest
1514
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
submodules: true
19-
20-
- name: Build SDist
21-
run: pipx run build --sdist
22-
23-
- name: Check metadata
24-
run: pipx run twine check dist/*
25-
26-
- uses: actions/upload-artifact@v4
27-
with:
28-
name: dist-sdist
29-
path: dist/*.tar.gz
15+
- uses: actions/checkout@v4
16+
with:
17+
submodules: true
18+
- run: pipx run build --sdist
19+
- run: pipx run twine check dist/* || exit 1 # Ensure failure on twine check errors
20+
- uses: actions/upload-artifact@v4
21+
with:
22+
name: dist-sdist
23+
path: dist/*.tar.gz
3024

3125
build_wheels:
32-
name: Build ${{ matrix.cpversion }} wheels on ${{ matrix.os }}
3326
runs-on: ${{ matrix.os }}
3427
strategy:
3528
fail-fast: false
3629
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.
30+
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, macos-13, windows-latest] # Use specific versions for clarity
31+
arch: [x86_64, arm64]
32+
pybuilds: [cp38, cp39, cp310, cp311, cp312] # Define pybuilds at the top level
4533
exclude:
46-
- os: macos-14
47-
cpversion: cp38
48-
34+
- os: ubuntu-24.04-arm # No need to specify arch, it's already implicit
35+
arch: x86_64 # Exclude x86_64 on ARM
36+
- os: macos-14 # Exclude macOS 14 (Sonoma)
37+
arch: x86_64 # Exclude x86_64 explicitly
38+
- os: macos-14 # Exclude cp38
39+
pybuilds: cp38
40+
- os: macos-13 # Exclude macOS 13 (Ventura) - arm64
41+
arch: arm64 # Exclude arm64 on macOS 13
42+
- os: macos-13
43+
pybuilds: cp38
4944

5045
steps:
5146
- uses: actions/checkout@v4
52-
5347
- uses: actions/setup-python@v5
5448
with:
5549
python-version: '3.12'
56-
57-
- name: Install cibuildwheel
58-
run: python -m pip install cibuildwheel==2.22.0
59-
60-
- name: Build wheels
61-
# why do I need to specify this cpversion here?
50+
- run: pip install cibuildwheel==2.22.0
51+
- run: python -m cibuildwheel --output-dir wheelhouse
6252
env:
63-
CIBW_ARCHS: "auto64"
64-
CIBW_BUILD: "${{ matrix.cpversion }}-*"
65-
# why isn't auto64 working?
66-
CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32"
67-
run: python -m cibuildwheel --output-dir wheelhouse
68-
69-
- uses: actions/upload-artifact@v4
53+
CIBW_BUILD: "${{ matrix.pybuilds }}-*" # Use matrix.pybuilds and matrix.arch
54+
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
55+
CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32"
56+
- name: Upload Artifact
57+
uses: actions/upload-artifact@v4
58+
continue-on-error: true # Important: Continue if upload fails
7059
with:
71-
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
60+
# Include pybuilds in the artifact name
61+
name: wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.pybuilds }}
7262
path: ./wheelhouse/*.whl
63+
if-no-files-found: error # Fail if no wheels are found
64+
compression-level: 6
65+
overwrite: false
66+
include-hidden-files: false
67+
68+
release_artifacts:
69+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
70+
needs: build_wheels
71+
runs-on: ubuntu-latest
72+
permissions:
73+
id-token: write
74+
contents: write
75+
steps:
76+
- uses: actions/download-artifact@v4
77+
with:
78+
path: ./artifacts
79+
merge-multiple: true
80+
- run: ls -R ./artifacts
81+
- uses: ncipollo/release-action@v1
82+
with:
83+
allowUpdates: true
84+
artifacts: "./artifacts/**/*"
85+
token: ${{ secrets.GITHUB_TOKEN }}
86+
- uses: pypa/[email protected]
87+
with:
88+
packages-dir: ./artifacts

pyproject.toml

+5
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)