-
Notifications
You must be signed in to change notification settings - Fork 47
112 lines (96 loc) · 2.81 KB
/
Copy pathbuild_wheels.yml
File metadata and controls
112 lines (96 loc) · 2.81 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build Wheels
on:
pull_request:
release:
types: [published]
workflow_dispatch:
jobs:
build_wheels_macos:
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }}) - ${{ matrix.py }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-13]
py: [cp39, cp310, cp311, cp312]
arch: [arm64, x86_64]
exclude:
# macos-14 is Apple Silicon (arm64)
- os: macos-14
arch: x86_64
# macos-13 is Intel (x86_64)
- os: macos-13
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: ${{ matrix.py }}-*
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.py }}
path: ./wheelhouse/*.whl
build_wheels_linux:
name: Build wheels on Linux (${{ matrix.arch }}) - ${{ matrix.py }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py: [cp39, cp310, cp311, cp312]
arch: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: ${{ matrix.py }}-manylinux_${{ matrix.arch }}
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
- uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.arch }}-${{ matrix.py }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
merge:
name: Merge artifacts
runs-on: ubuntu-latest
needs: [build_wheels_macos, build_wheels_linux, build_sdist]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: all-wheels
delete-merged: true
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [merge]
if: github.event_name == 'release' && github.event.action == 'published'
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: all-wheels
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1