-
Notifications
You must be signed in to change notification settings - Fork 13
215 lines (183 loc) · 6.42 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Build wheels and sdist and upload to PyPI
on:
release:
types:
- published
workflow_dispatch:
jobs:
build_many_wheels:
name: Standard linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.5
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: "x86_64"
CIBW_BUILD: "*manylinux*"
CIBW_SKIP: cp36* cp37* cp38* pp*
CIBW_BUILD_VERBOSITY: 3
CIBW_BEFORE_BUILD: pip install -U pybind11-global
CIBW_BEFORE_TEST: pip install -U pytest pytest-timeout pytest-cov pytest-xdist
CIBW_TEST_COMMAND: pytest --skip_gha {package}/tests
- uses: actions/upload-artifact@v4
with:
name: manylinux-artifacts
path: ./wheelhouse/*.whl
build_musl_wheels:
name: Musl linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.5
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: "x86_64"
CIBW_BUILD: "*musllinux*"
CIBW_SKIP: cp36* cp37* cp38* pp*
CIBW_BUILD_VERBOSITY: 3
CIBW_BEFORE_BUILD: >-
apk add --no-cache jpeg-dev zlib-dev openblas-dev &&
pip install -U pybind11-global
CIBW_BEFORE_TEST: pip install -U pytest pytest-timeout pytest-cov pytest-xdist
CIBW_TEST_COMMAND: pytest --skip_gha {package}/tests
- uses: actions/upload-artifact@v4
with:
name: musllinux-artifacts
path: ./wheelhouse/*.whl
build_macosx_x86_wheels:
name: MacOS x86
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.5
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: "x86_64"
CIBW_BUILD: "*macosx*"
CIBW_SKIP: cp36* cp37* cp38* pp*
CIBW_BUILD_VERBOSITY: 3
CIBW_BEFORE_BUILD: >-
pip install -U pybind11-global &&
brew install llvm libomp fftw eigen
CIBW_ENVIRONMENT: >-
CC=/usr/local/opt/llvm/bin/clang
CXX=/usr/local/opt/llvm/bin/clang++
LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
CPPFLAGS="-I/usr/local/opt/llvm/include"
CIBW_BEFORE_TEST: pip install -U pytest pytest-timeout pytest-cov pytest-xdist
CIBW_TEST_COMMAND: pytest --skip_gha {package}/tests
- uses: actions/upload-artifact@v4
with:
name: macosx-x86-artifacts
path: ./wheelhouse/*.whl
build_macosx_arm_wheels:
name: MacOS ARM
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.5
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: "arm64"
CIBW_BUILD: "*macosx*"
CIBW_SKIP: cp36* cp37* cp38* pp*
CIBW_BUILD_VERBOSITY: 3
CIBW_BEFORE_BUILD: >-
pip install -U pybind11-global &&
brew install llvm libomp fftw eigen
CIBW_ENVIRONMENT: >-
CC=/opt/homebrew/opt/llvm/bin/clang
CXX=/opt/homebrew/opt/llvm/bin/clang++
LDFLAGS="-L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib"
CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
PATH="/opt/homebrew/opt/llvm/bin:$PATH"
FFTW_DIR="/opt/homebrew"
CIBW_BEFORE_TEST: pip install -U pytest pytest-timeout pytest-cov pytest-xdist
CIBW_TEST_COMMAND: pytest --skip_gha {package}/tests
- uses: actions/upload-artifact@v4
with:
name: macosx-arm-artifacts
path: ./wheelhouse/*.whl
merge_wheels:
name: Merge wheels
needs: [build_many_wheels, build_musl_wheels, build_macosx_x86_wheels, build_macosx_arm_wheels]
runs-on: ubuntu-latest
steps:
- name: Merge wheels
uses: actions/upload-artifact/merge@v4
with:
name: wheels
pattern: "*-artifacts"
build_sdist:
name: Build sdist and upload to PyPI
needs: [merge_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install -U pip
pip install build setuptools_scm
pip install -U numpy setuptools
pip install -U -r requirements.txt
pip install -U pybind11-global
- name: Extract version
run: |
echo "PACKAGE_VERSION=$(python -c 'from setuptools_scm import get_version; print(get_version())')" >> $GITHUB_ENV
- name: Download wheels
uses: actions/download-artifact@v4
with:
path: ./wheels
- name: Build sdist
run: |
python -m build --sdist
ls -l dist
tar tvfz dist/batoid-*.tar.gz
- name: Copy wheels
run: |
echo ls -l wheels
ls -l wheels
echo ls -l wheels/wheels
ls -l wheels/wheels
cp wheels/wheels/*.whl dist
echo ls -l dist
ls -l dist
- name: Publish to TestPyPI if alpha
if: "contains(env.PACKAGE_VERSION, 'a') && !contains(env.PACKAGE_VERSION, '.dev')"
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
password: ${{ secrets.TESTPYPI_PASSWORD }}
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI if stable release
if: "!contains(env.PACKAGE_VERSION, 'a') && !contains(env.PACKAGE_VERSION, '.dev')"
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}
verbose: true