@@ -12,11 +12,29 @@ permissions:
12
12
13
13
env :
14
14
TERM : xterm
15
- PYTHON_VERSION : 3.11
15
+ PYTHON_VERSION : 3.12
16
16
17
17
jobs :
18
- packages-build :
19
- name : Build packages
18
+ check-version :
19
+ name : Check version
20
+ runs-on : ubuntu-latest
21
+ if : startsWith(github.ref, 'refs/tags/')
22
+
23
+ steps :
24
+ - uses : actions/checkout@v4
25
+
26
+ - name : Set up Python
27
+ uses : actions/setup-python@v5
28
+ with :
29
+ python-version : ${{ env.PYTHON_VERSION }}
30
+
31
+ - uses : astral-sh/setup-uv@v4
32
+
33
+ - name : Check version matching the tag
34
+ run : make check-version
35
+
36
+ check-code :
37
+ name : Check code
20
38
runs-on : ubuntu-latest
21
39
env :
22
40
RUFF_FORMAT : github
@@ -29,35 +47,27 @@ jobs:
29
47
with :
30
48
python-version : ${{ env.PYTHON_VERSION }}
31
49
32
- - name : Prepare virtual environment
33
- run : make create-env
50
+ - uses : astral-sh/setup-uv@v4
34
51
35
52
- name : Check format
36
53
run : |
37
54
make check-format || true
38
55
BOLDRED=$(tput bold && tput setaf 1)
39
56
RESET=$(tput sgr0)
40
- echo "${BOLDRED}==> We won't fail on formatting errors for the time being, but we will in the future.${RESET}"
57
+ echo "${BOLDRED}==> We won't penalise formatting errors for the time being, but we will in the future.${RESET}"
41
58
42
59
- name : Check lint
43
60
run : |
44
61
make check-lint || true
45
62
BOLDRED=$(tput bold && tput setaf 1)
46
63
RESET=$(tput sgr0)
47
- echo "${BOLDRED}==> We won't fail on lint errors for the time being, but we will in the future.${RESET}"
48
-
49
- - name : Build packages
50
- run : make build-dist
64
+ echo "${BOLDRED}==> We won't enforce linting errors for the time being, but we will in the future.${RESET}"
51
65
52
- - name : Upload packages
53
- uses : actions/upload-artifact@v4
54
- with :
55
- name : python-packages
56
- path : dist
57
-
58
- docker-build :
59
- name : Build Docker image
66
+ docs-build :
67
+ name : Build documentation
60
68
runs-on : ubuntu-latest
69
+ needs :
70
+ - check-code
61
71
62
72
steps :
63
73
- uses : actions/checkout@v4
@@ -67,22 +77,23 @@ jobs:
67
77
with :
68
78
python-version : ${{ env.PYTHON_VERSION }}
69
79
70
- - name : Prepare virtual environment
71
- run : make create-env
72
-
73
- - name : Check Dockerfile
74
- run : make check-docker
80
+ - uses : astral-sh/setup-uv@v4
75
81
76
- - name : Build Docker image
77
- run : make build-image
82
+ - name : Build the docs
83
+ shell : bash
84
+ run : make docs
78
85
79
- # TODO: Enable this when we figure out how to run it without having to download several Gigabytes of data.
80
- # - name: Test Docker image
81
- # run: make run-example
86
+ - name : Upload documentation
87
+ uses : actions/upload-artifact@v4
88
+ with :
89
+ name : documentation
90
+ path : docs/build
82
91
83
- docs -build :
84
- name : Build documentation
92
+ sdist -build :
93
+ name : Build sdist
85
94
runs-on : ubuntu-latest
95
+ needs :
96
+ - check-code
86
97
87
98
steps :
88
99
- uses : actions/checkout@v4
@@ -92,27 +103,26 @@ jobs:
92
103
with :
93
104
python-version : ${{ env.PYTHON_VERSION }}
94
105
95
- - name : Prepare virtual environment
96
- run : make create-env
106
+ - uses : astral-sh/setup-uv@v4
97
107
98
- - name : Check version matching the tag
99
- shell : bash
100
- run : make docs
108
+ - name : Build sdist
109
+ run : make build-sdist
101
110
102
- - name : Upload documentation
111
+ - name : Upload packages
103
112
uses : actions/upload-artifact@v4
104
113
with :
105
- name : documentation
106
- path : docs/build
114
+ name : packages-sdist
115
+ path : dist
107
116
108
- check-version :
109
- name : Check version
110
- runs-on : ubuntu-latest
111
- if : startsWith(github.ref, 'refs/tags/')
117
+ wheels-build :
118
+ name : Build wheels
119
+ runs-on : ${{ matrix.os }}
120
+ strategy :
121
+ fail-fast : false
122
+ matrix :
123
+ os : [ubuntu-latest, macos-latest]
112
124
needs :
113
- - packages-build
114
- - docker-build
115
- - docs-build
125
+ - check-code
116
126
117
127
steps :
118
128
- uses : actions/checkout@v4
@@ -122,18 +132,25 @@ jobs:
122
132
with :
123
133
python-version : ${{ env.PYTHON_VERSION }}
124
134
125
- - name : Prepare virtual environment
126
- run : make create-env
135
+ - uses : astral-sh/setup-uv@v4
127
136
128
- - name : Check version matching the tag
129
- run : make check-version
137
+ - name : Build wheels
138
+ run : make build-wheels
130
139
140
+ - name : Upload packages
141
+ uses : actions/upload-artifact@v4
142
+ with :
143
+ name : packages-wheels-${{ matrix.os }}
144
+ path : dist
145
+
131
146
packages-publish :
132
147
name : Publish packages
133
148
runs-on : ubuntu-latest
134
149
if : startsWith(github.ref, 'refs/tags/')
135
150
needs :
136
151
- check-version
152
+ - sdist-build
153
+ - wheels-build
137
154
138
155
steps :
139
156
- uses : actions/checkout@v4
@@ -143,37 +160,74 @@ jobs:
143
160
with :
144
161
python-version : ${{ env.PYTHON_VERSION }}
145
162
146
- - name : Prepare virtual environment
147
- run : make create-env
163
+ - uses : astral-sh/setup-uv@v4
148
164
149
165
- name : Download packages
150
166
uses : actions/download-artifact@v4
151
167
with :
152
- name : python-packages
168
+ pattern : packages-*
169
+ merge-multiple : true
170
+ path : dist
153
171
154
172
- name : Publish to PyPI
155
173
env :
156
174
PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
157
175
run : make publish-dist
158
176
177
+ docker-build :
178
+ name : Build Docker image
179
+ runs-on : ubuntu-latest
180
+ needs :
181
+ - check-code
182
+
183
+ steps :
184
+ - uses : actions/checkout@v4
185
+
186
+ - name : Set up Python
187
+ uses : actions/setup-python@v5
188
+ with :
189
+ python-version : ${{ env.PYTHON_VERSION }}
190
+
191
+ - uses : astral-sh/setup-uv@v4
192
+
193
+ - name : Check Dockerfile
194
+ run : make check-docker
195
+
196
+ - name : Build Docker image
197
+ run : make save-image
198
+
199
+ # TODO: Enable this when we figure out how to run it without having to download several Gigabytes of data.
200
+ # - name: Test Docker image
201
+ # run: make run-example
202
+
203
+ - name : Upload Docker image
204
+ uses : actions/upload-artifact@v4
205
+ with :
206
+ name : docker-image
207
+ path : oncodrivefml.tar
208
+
159
209
docker-push :
160
210
name : Push Docker image
161
211
if : startsWith(github.ref, 'refs/tags/')
162
212
runs-on : ubuntu-latest
163
213
needs :
164
214
- check-version
215
+ - docker-build
165
216
166
217
steps :
167
- - if : ${{ env.DOCKER_USERNAME != '' }}
168
- uses : actions/checkout@v3
218
+ - uses : actions/checkout@v4
169
219
170
220
- name : Set up Python
171
221
uses : actions/setup-python@v5
172
222
with :
173
223
python-version : ${{ env.PYTHON_VERSION }}
174
224
175
- - name : Prepare virtual environment
176
- run : make create-env
225
+ - uses : astral-sh/setup-uv@v4
226
+
227
+ - name : Download Docker image
228
+ uses : actions/download-artifact@v4
229
+ with :
230
+ name : docker-image
177
231
178
232
- name : Login to DockerHub
179
233
env :
@@ -182,4 +236,4 @@ jobs:
182
236
run : make docker-login
183
237
184
238
- name : Push Docker image
185
- run : make push-image
239
+ run : make load-image push-image
0 commit comments