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