4
4
tags :
5
5
- " v*"
6
6
- " buildwheels*"
7
+ branches :
8
+ # Runs on every merge to master to upload .dev0 wheels to anaconda.org
9
+ - master
10
+ - v1.**
11
+ # Make it possible to upload wheels manually if needed
12
+ workflow_dispatch :
13
+ inputs :
14
+ push_wheels :
15
+ description : >
16
+ 'Push wheels to Anaconda if "true". Default is "false". Warning: this will overwrite existing wheels.'
17
+ required : false
18
+ default : " false"
19
+ # Upload wheels to anaconda.org on a schedule
20
+ schedule :
21
+ # Run at 0300 hours on days 3 and 17 of the month
22
+ - cron : " 0 3 3,17 * *"
7
23
env :
8
24
CIBW_BUILD_VERBOSITY : 2
9
25
# CIBW_BEFORE_BUILD: pip install cython
@@ -19,33 +35,32 @@ jobs:
19
35
fail-fast : false
20
36
matrix :
21
37
os : [ubuntu-latest]
22
- cibw_python : ["cp39-* ", "cp310-* ", "cp311-* ", "cp312-* "]
38
+ cibw_python : ["cp39", "cp310", "cp311", "cp312"]
23
39
cibw_manylinux : [manylinux2014]
24
40
cibw_arch : ["x86_64"]
25
41
steps :
26
- - uses : actions/checkout@v4
42
+ - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
27
43
with :
28
44
fetch-depth : 0
29
45
- uses : actions/setup-python@v5
30
46
name : Install Python
31
47
with :
32
48
python-version : " 3.9"
33
- - name : Install cibuildwheel
34
- run : |
35
- python -m pip install cibuildwheel
36
49
- name : Build the wheel
37
- run : |
38
- python -m cibuildwheel --output-dir dist
50
+ uses : pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
51
+ with :
52
+ output-dir : dist
39
53
env :
40
- CIBW_BUILD : ${{ matrix.cibw_python }}
54
+ CIBW_BUILD : ${{ matrix.cibw_python }}-*
41
55
CIBW_ARCHS_LINUX : ${{ matrix.cibw_arch }}
42
56
CIBW_SKIP : " *-musllinux_*"
43
57
CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.cibw_manylinux }}
44
58
CIBW_MANYLINUX_I686_IMAGE : " manylinux2010"
45
- - uses : actions/upload-artifact@v4
59
+ - uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
46
60
with :
47
- name : wheels
61
+ name : wheels_linux_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}_manylinux2014
48
62
path : ./dist/*.whl
63
+ if-no-files-found : error
49
64
50
65
build_linux_aarch64_wheels :
51
66
name : Build python ${{ matrix.cibw_python }} aarch64 wheels on ${{ matrix.os }}
@@ -54,10 +69,11 @@ jobs:
54
69
fail-fast : false
55
70
matrix :
56
71
os : [ubuntu-latest]
57
- cibw_python : ["cp39-* ", "cp310-* ", "cp311-* ", "cp312-* "]
72
+ cibw_python : ["cp39", "cp310", "cp311", "cp312"]
58
73
cibw_manylinux : [manylinux2014]
74
+ cibw_arch : ["aarch64"]
59
75
steps :
60
- - uses : actions/checkout@v4
76
+ - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
61
77
with :
62
78
fetch-depth : 0
63
79
- uses : actions/setup-python@v5
@@ -68,20 +84,18 @@ jobs:
68
84
uses : docker/setup-qemu-action@v3
69
85
with :
70
86
platforms : arm64
71
- - name : Install cibuildwheel
72
- run : |
73
- python -m pip install cibuildwheel
74
87
- name : Build the wheel
75
- run : |
76
- python -m cibuildwheel --output-dir dist
88
+ uses : pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
89
+ with :
90
+ output-dir : dist
77
91
env :
78
- CIBW_BUILD : ${{ matrix.cibw_python }}
79
- CIBW_ARCHS_LINUX : aarch64
92
+ CIBW_BUILD : ${{ matrix.cibw_python }}-*
93
+ CIBW_ARCHS_LINUX : ${{ matrix.cibw_arch }}
80
94
CIBW_SKIP : " *-musllinux_*"
81
95
CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.cibw_manylinux }}
82
- - uses : actions/upload-artifact@v4
96
+ - uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
83
97
with :
84
- name : wheels
98
+ name : wheels_linux_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}_manylinux2014
85
99
path : ./dist/*.whl
86
100
87
101
build_macos_wheels :
@@ -91,10 +105,10 @@ jobs:
91
105
fail-fast : false
92
106
matrix :
93
107
os : [macos-latest]
94
- cibw_python : ["cp39-* ", "cp310-* ", "cp311-* ", "cp312-* "]
108
+ cibw_python : ["cp39", "cp310", "cp311", "cp312"]
95
109
cibw_arch : ["x86_64", "arm64"]
96
110
steps :
97
- - uses : actions/checkout@v4
111
+ - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
98
112
with :
99
113
fetch-depth : 0
100
114
@@ -103,33 +117,19 @@ jobs:
103
117
with :
104
118
python-version : " 3.9"
105
119
106
- - name : Install cibuildwheel
107
- run : |
108
- python -m pip install cibuildwheel
109
-
110
- - name : Build wheels for CPython (MacOS)
111
- run : |
112
- # We need to set both MACOS_DEPLOYMENT_TARGET and MACOSX_DEPLOYMENT_TARGET
113
- # until there is a new release with this commit:
114
- # https://github.com/mesonbuild/meson-python/pull/309 (should be in 0.13.0)
115
- if [[ "$CIBW_ARCHS_MACOS" == arm64 ]]; then
116
- export MACOSX_DEPLOYMENT_TARGET=11.0
117
- export MACOS_DEPLOYMENT_TARGET=11.0
118
- else
119
- export MACOSX_DEPLOYMENT_TARGET=10.13
120
- export MACOS_DEPLOYMENT_TARGET=10.13
121
- fi
122
- echo MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
123
-
124
- python -m cibuildwheel --output-dir dist
120
+ - name : Build wheels for CPython (macOS)
121
+ uses : pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
122
+ with :
123
+ output-dir : dist
125
124
env :
126
- CIBW_BUILD : ${{ matrix.cibw_python }}
125
+ CIBW_BUILD : ${{ matrix.cibw_python }}-*
127
126
CIBW_ARCHS_MACOS : ${{ matrix.cibw_arch }}
128
127
129
- - uses : actions/upload-artifact@v4
128
+ - uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
130
129
with :
131
- name : wheels
130
+ name : wheels_macos_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
132
131
path : ./dist/*.whl
132
+ if-no-files-found : error
133
133
134
134
build_windows_wheels :
135
135
name : Build ${{ matrix.cibw_python }} ${{ matrix.cibw_arch }} wheels on ${{ matrix.os }}
@@ -139,9 +139,9 @@ jobs:
139
139
matrix :
140
140
os : [windows-latest]
141
141
cibw_arch : ["AMD64", "x86"]
142
- cibw_python : ["cp39-* ", "cp310-* ", "cp311-* ", "cp312-* "]
142
+ cibw_python : ["cp39", "cp310", "cp311", "cp312"]
143
143
steps :
144
- - uses : actions/checkout@v4
144
+ - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
145
145
with :
146
146
fetch-depth : 0
147
147
@@ -150,10 +150,6 @@ jobs:
150
150
with :
151
151
python-version : " 3.9"
152
152
153
- - name : Install cibuildwheel
154
- run : |
155
- python -m pip install cibuildwheel
156
-
157
153
- name : Setup MSVC (32-bit)
158
154
if : matrix.cibw_arch == 'x86'
159
155
uses : bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
@@ -167,30 +163,33 @@ jobs:
167
163
architecture : x64
168
164
169
165
- name : Build Windows wheels for CPython
170
- run : |
171
- python -m cibuildwheel --output-dir dist
166
+ uses : pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
167
+ with :
168
+ output-dir : dist
172
169
env :
173
- CIBW_BUILD : ${{ matrix.cibw_python }}
170
+ CIBW_BUILD : ${{ matrix.cibw_python }}-*
174
171
CIBW_ARCHS_WINDOWS : ${{ matrix.cibw_arch }}
175
172
176
- - uses : actions/upload-artifact@v4
173
+ - uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
177
174
with :
178
- name : wheels
175
+ name : wheels_windows_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
179
176
path : ./dist/*.whl
177
+ if-no-files-found : error
180
178
181
- deploy :
182
- name : Release
179
+ deploy_pypi :
180
+ name : Release (PyPI)
183
181
needs :
184
182
[
185
183
build_linux_x86_64_wheels,
186
184
build_linux_aarch64_wheels,
187
185
build_macos_wheels,
188
186
build_windows_wheels,
189
187
]
190
- if : github.repository_owner == 'PyWavelets' && startsWith(github.ref, 'refs/tags/v') && always()
188
+ # Run only on tags pushed to the repository
189
+ if : github.repository == 'PyWavelets/pywt' && startsWith(github.ref, 'refs/tags/v')
191
190
runs-on : ubuntu-latest
192
191
steps :
193
- - uses : actions/checkout@v4
192
+ - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
194
193
with :
195
194
fetch-depth : 0
196
195
@@ -204,11 +203,13 @@ jobs:
204
203
python -m pip install --upgrade pip
205
204
pip install twine
206
205
pip install cython numpy build
207
- - uses : actions/download-artifact@v4
206
+
207
+ - uses : actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
208
208
id : download
209
209
with :
210
- name : wheels
210
+ pattern : " wheels_* "
211
211
path : ./dist
212
+ merge-multiple : true
212
213
213
214
- name : Publish the source distribution on PyPI
214
215
run : |
@@ -224,7 +225,41 @@ jobs:
224
225
TWINE_PASSWORD : ${{ secrets.TWINE_TOKEN }}
225
226
226
227
- name : Github release
227
- uses : softprops/action-gh-release@v2
228
+ uses : softprops/action-gh-release@d99959edae48b5ffffd7b00da66dcdb0a33a52ee # v2.0.2
228
229
env :
229
230
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
230
231
GITHUB_REPOSITORY : ${{ github.repository }}
232
+
233
+ deploy_anaconda :
234
+ name : Release (Anaconda)
235
+ needs :
236
+ [
237
+ build_linux_x86_64_wheels,
238
+ build_linux_aarch64_wheels,
239
+ build_macos_wheels,
240
+ build_windows_wheels,
241
+ ]
242
+ # Run only on pushes to the master branch, on schedule, or when triggered manually
243
+ if : >-
244
+ github.repository == 'PyWavelets/pywt' &&
245
+ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
246
+ (github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
247
+ (github.event_name == 'schedule')
248
+ runs-on : ubuntu-latest
249
+ steps :
250
+ - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
251
+ with :
252
+ fetch-depth : 0
253
+
254
+ - uses : actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
255
+ id : download
256
+ with :
257
+ pattern : " *_wheels"
258
+ path : dist/
259
+ merge-multiple : true
260
+
261
+ - name : Push to Anaconda PyPI index
262
+ uses : scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
263
+ with :
264
+ artifacts_path : dist/
265
+ anaconda_nightly_upload_token : ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
0 commit comments