-
Notifications
You must be signed in to change notification settings - Fork 66
88 lines (83 loc) · 2.8 KB
/
wheels.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Wheels
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: pipx run build --sdist
- run: pipx run twine check dist/* || exit 1 # Ensure failure on twine check errors
- uses: actions/upload-artifact@v4
with:
name: dist-sdist
path: dist/*.tar.gz
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, macos-13, windows-latest] # Use specific versions for clarity
arch: [x86_64, arm64]
pybuilds: [cp38, cp39, cp310, cp311, cp312] # Define pybuilds at the top level
exclude:
- os: ubuntu-24.04-arm # No need to specify arch, it's already implicit
arch: x86_64 # Exclude x86_64 on ARM
- os: macos-14 # Exclude macOS 14 (Sonoma)
arch: x86_64 # Exclude x86_64 explicitly
- os: macos-14 # Exclude cp38
pybuilds: cp38
- os: macos-13 # Exclude macOS 13 (Ventura) - arm64
arch: arm64 # Exclude arm64 on macOS 13
- os: macos-13
pybuilds: cp38
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install cibuildwheel==2.23.0
- run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: "${{ matrix.pybuilds }}-*" # Use matrix.pybuilds and matrix.arch
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
CIBW_SKIP: "cp*-manylinux_i686 cp*-musllinux* cp*-win32"
- name: Upload Artifact
uses: actions/upload-artifact@v4
continue-on-error: true # Important: Continue if upload fails
with:
# Include pybuilds in the artifact name
name: wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.pybuilds }}
path: ./wheelhouse/*.whl
if-no-files-found: error # Fail if no wheels are found
compression-level: 6
overwrite: false
include-hidden-files: false
release_artifacts:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: build_wheels
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: ./artifacts
merge-multiple: true
- run: ls -R ./artifacts
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "./artifacts/**/*"
token: ${{ secrets.GITHUB_TOKEN }}
- uses: pypa/[email protected]
with:
packages-dir: ./artifacts