-
Notifications
You must be signed in to change notification settings - Fork 1
321 lines (286 loc) · 10 KB
/
Copy pathwheels.yml
File metadata and controls
321 lines (286 loc) · 10 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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
name: Publish sdist and wheels
env:
SOURCE_REF_TO_BUILD: main
on:
schedule:
# 01:01 UTC every Monday and Thursday.
- cron: "1 1 * * 1,4"
pull_request:
branches:
- main
- "[0-9]+.[0-9]+.X"
push:
branches:
- main
workflow_dispatch:
inputs:
environment:
description: Which PyPI environment to upload to, if any
required: true
type: choice
options: ["none", "chain", "testpypi", "pypi"]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}
if: github.repository == 'scikit-learn/scikit-learn-release'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
include:
# Window 64 bit
- os: windows-latest
python: 311
platform_id: win_amd64
- os: windows-latest
python: 312
platform_id: win_amd64
- os: windows-latest
python: 313
platform_id: win_amd64
- os: windows-latest
python: 314
platform_id: win_amd64
- os: windows-latest
python: 314t
platform_id: win_amd64
# Windows on ARM64 (WoA)
- os: windows-11-arm
python: 311
platform_id: win_arm64
- os: windows-11-arm
python: 312
platform_id: win_arm64
- os: windows-11-arm
python: 313
platform_id: win_arm64
- os: windows-11-arm
python: 314
platform_id: win_arm64
- os: windows-11-arm
python: 314t
platform_id: win_arm64
# Linux
- os: ubuntu-latest
python: 311
platform_id: manylinux_x86_64
- os: ubuntu-latest
python: 312
platform_id: manylinux_x86_64
- os: ubuntu-latest
python: 313
platform_id: manylinux_x86_64
- os: ubuntu-latest
python: 314
platform_id: manylinux_x86_64
- os: ubuntu-latest
python: 314t
platform_id: manylinux_x86_64
# Linux arm
- os: ubuntu-24.04-arm
python: 311
platform_id: manylinux_aarch64
- os: ubuntu-24.04-arm
python: 312
platform_id: manylinux_aarch64
- os: ubuntu-24.04-arm
python: 313
platform_id: manylinux_aarch64
- os: ubuntu-24.04-arm
python: 314
platform_id: manylinux_aarch64
- os: ubuntu-24.04-arm
python: 314t
platform_id: manylinux_aarch64
# MacOS x86_64
- os: macos-15-intel
python: 311
platform_id: macosx_x86_64
- os: macos-15-intel
python: 312
platform_id: macosx_x86_64
- os: macos-15-intel
python: 313
platform_id: macosx_x86_64
- os: macos-15-intel
python: 314
platform_id: macosx_x86_64
- os: macos-15-intel
python: 314t
platform_id: macosx_x86_64
# MacOS arm64
- os: macos-14
python: 311
platform_id: macosx_arm64
- os: macos-14
python: 312
platform_id: macosx_arm64
- os: macos-14
python: 313
platform_id: macosx_arm64
- os: macos-14
python: 314
platform_id: macosx_arm64
- os: macos-14
python: 314t
platform_id: macosx_arm64
steps:
- name: Checkout scikit-learn-release
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Checkout scikit-learn
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
repository: scikit-learn/scikit-learn
ref: ${{ env.SOURCE_REF_TO_BUILD }}
path: scikit-learn-src
persist-credentials: false
- uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
if: ${{ startsWith(matrix.platform_id, 'macosx') }}
with:
micromamba-version: '2.8.1-0'
- name: Set-up macOS
if: ${{ startsWith(matrix.platform_id, 'macosx') }}
run: bash tools/configure_macos_env.sh
- name: Set SOURCE_DATE_EPOCH from source commit
run: |
echo "SOURCE_DATE_EPOCH=$(git -C scikit-learn-src log -1 --pretty=%ct)" >> "$GITHUB_ENV"
- name: Build and test wheels
uses: pypa/cibuildwheel@f03ac7617d6cff873ccf24cc0d567ef5ba5a9e6d # v4.0.0
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_BEFORE_TEST_WINDOWS: bash tools/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.platform_id }}
CIBW_TEST_COMMAND_WINDOWS: bash {project}/tools/test_windows_wheels.sh ${{ matrix.python }} {project} ${{ matrix.platform_id }}
SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }}
PYTHONHASHSEED: "0"
CIBW_ENVIRONMENT_PASS_LINUX: SOURCE_DATE_EPOCH PYTHONHASHSEED RUNNER_OS
with:
package-dir: scikit-learn-src
output-dir: dist
config-file: cibuildwheel.toml
- name: Store artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cibw-wheels-cp${{ matrix.python }}-${{ matrix.platform_id }}
path: ./dist/*.whl
build_sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- name: Checkout scikit-learn-release
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Checkout scikit-learn
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
repository: scikit-learn/scikit-learn
ref: ${{ env.SOURCE_REF_TO_BUILD }}
path: scikit-learn-src
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # 6.2.0
with:
python-version: "3.12"
- name: Build source distribution
run: bash tools/build_source.sh
- name: Test source distribution
run: bash tools/test_source.sh
- name: Store artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cibw-sdist
path: dist/*.tar.gz
testpypi-publish:
name: Publish release to TestPyPI
if: github.event_name == 'workflow_dispatch' && (github.event.inputs.environment == 'testpypi' || github.event.inputs.environment == 'chain')
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
environment:
name: testpypi
url: https://test.pypi.org/p/scikit-learn
permissions:
id-token: write # mandatory for trusted publishing
steps:
- name: Download sdist and wheels
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: dist
merge-multiple: true
- name: View artifacts
run: ls dist
# - name: Publish
# uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
# with:
# repository-url: https://test.pypi.org/legacy/
# skip-existing: true
# print-hash: true
# attestations: true
nightly_upload:
name: Nightly upload
if: github.repository == 'scikit-learn/scikit-learn-release' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'none'))
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- name: Download sdist and wheels
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: dist
merge-multiple: true
- name: Install micromamba
uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
# For installation of anaconda-client, required for upload to anaconda.org
init-shell: bash
environment-name: upload-env
create-args: >-
anaconda-client
# - name: Upload to anaconda.org
# shell: bash -el {0} # required for micromamba
# env:
# TOKEN: ${{ secrets.SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN }}
# run: |
# anaconda -q -t ${TOKEN} upload --force -u scientific-python-nightly-wheels ./dist/*.whl
pypi-publish:
name: Publish release to PyPI
if: >-
github.event_name == 'workflow_dispatch'
&& (
github.event.inputs.environment == 'pypi'
|| (
github.event.inputs.environment == 'chain'
&& (needs.testpypi-publish.result == 'success' || needs.testpypi-publish.result == 'skipped')
)
)
runs-on: ubuntu-latest
# environment:
# name: pypi
# url: https://pypi.org/p/scikit-learn
# permissions:
# id-token: write # mandatory for trusted publishing
needs: [build_wheels, build_sdist, testpypi-publish]
environment:
name: pypi
url: https://pypi.org/p/scikit-learn
permissions:
id-token: write # mandatory for trusted publishing
steps:
- name: Download sdist and wheels
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: dist
merge-multiple: true
- name: View artifacts
run: ls dist
# - name: Publish
# uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
# with:
# print-hash: true
# attestations: true