-
Notifications
You must be signed in to change notification settings - Fork 14
166 lines (154 loc) · 4.73 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Build wheel
on:
push:
branches:
- main
release:
types:
- created
env:
cibuildwheel_version: "2.12.2"
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
name: Install Python
with:
python-version: "3.11"
- name: Build sdist
run: pip install pybind11 && python setup.py sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
MACOSX_DEPLOYMENT_TARGET: "10.9"
CIBW_BUILD_VERBOSITY: "1"
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
CIBW_SKIP: "${{ matrix.cibw.skip || '' }}"
CIBW_ENVIRONMENT: "${{ matrix.cibw.env || '' }}"
CIBW_TEST_COMMAND: "pytest {project}/tests"
CIBW_TEST_REQUIRES: pytest pytest-mock
CIBW_MANYLINUX_X86_64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_MANYLINUX_I686_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_MANYLINUX_AARCH64_IMAGE: "${{ matrix.cibw.manylinux_image }}"
CIBW_ARCHS_LINUX: "${{ matrix.cibw.arch || 'auto' }}"
CIBW_ARCHS_MACOS: "${{ matrix.cibw.arch || 'auto' }}"
strategy:
matrix:
include:
- os: macos-10.15
name: mac
cibw:
arch: x86_64
build: "cp37* cp38*"
- os: macos-10.15
name: mac-arm
cibw:
arch: universal2
build: "cp39* cp310* cp311*"
- os: ubuntu-20.04
name: manylinux1
cibw:
build: "cp37*"
skip: "*musllinux*"
manylinux_image: manylinux2010
arch: auto64
- os: ubuntu-20.04
name: manylinux2014
cibw:
build: "cp38* cp39* cp310* cp311*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: auto64
- os: ubuntu-20.04
name: manylinux_aarch64_cp37
cibw:
build: "cp37*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64
- os: ubuntu-20.04
name: manylinux_aarch64_cp38
cibw:
build: "cp38*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64
- os: ubuntu-20.04
name: manylinux_aarch64_cp39
cibw:
build: "cp39*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64
- os: ubuntu-20.04
name: manylinux_aarch64_cp310
cibw:
build: "cp310*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64
- os: ubuntu-20.04
name: manylinux_aarch64_cp311
cibw:
build: "cp311*"
skip: "*musllinux*"
manylinux_image: manylinux2014
arch: aarch64
- os: windows-2019
name: win_amd64
architecture: x64
cibw:
skip: "cp36*"
build: "cp*win_amd64"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
name: Install Python
- name: register qemu
if: contains(matrix.cibw.arch, 'aarch64')
run: |
docker run --rm --privileged hypriot/qemu-register:v4.2.0
- name: Install cibuildwheel
run: python -m pip install cibuildwheel=="${{env.cibuildwheel_version}}"
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_APITOKEN }}
packages_dir: dist/
repository_url: https://test.pypi.org/legacy/
verbose: true
skip_existing: true
- name: Publish package to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_APITOKEN }}
packages_dir: dist/
verbose: true
skip_existing: true