90
90
run : |
91
91
case "${{ matrix.os }}" in
92
92
ubuntu-latest)
93
+ echo OS_TAG=linux >> $GITHUB_ENV
93
94
sudo apt-get install libopenslide0
94
95
;;
95
96
macos-latest)
97
+ echo OS_TAG=macos >> $GITHUB_ENV
96
98
brew install openslide
97
99
;;
98
100
esac
@@ -115,26 +117,35 @@ jobs:
115
117
exit 1
116
118
fi
117
119
esac
118
- mkdir -p "artifacts/${{ needs.pre-commit.outputs.dist-base }}"
119
- mv dist/* "artifacts/${{ needs.pre-commit.outputs.dist-base }}"
120
+ if [ -z "$wheel_only" ]; then
121
+ mkdir -p "artifacts/src/${{ needs.pre-commit.outputs.dist-base }}"
122
+ mv dist/*.tar.gz "artifacts/src/${{ needs.pre-commit.outputs.dist-base }}"
123
+ fi
124
+ mkdir -p "artifacts/whl/${{ needs.pre-commit.outputs.dist-base }}"
125
+ mv dist/* "artifacts/whl/${{ needs.pre-commit.outputs.dist-base }}"
120
126
# save version-specific wheels and oldest abi3 wheel
121
127
python -c 'import sys
122
128
if sys.version_info < (3, 12): print("archive_wheel=1")' >> $GITHUB_ENV
123
129
- name : Install
124
- run : pip install artifacts/${{ needs.pre-commit.outputs.dist-base }}/*.whl
130
+ run : pip install artifacts/whl/ ${{ needs.pre-commit.outputs.dist-base }}/*.whl
125
131
- name : Run tests
126
132
run : pytest -v
127
133
- name : Tile slide
128
134
run : python examples/deepzoom/deepzoom_tile.py --viewer -o tiled tests/fixtures/small.svs
129
- - name : Remove wheel from upload
130
- if : matrix.sdist && ! env.archive_wheel
131
- run : rm artifacts/${{ needs.pre-commit.outputs.dist-base }}/*.whl
132
- - name : Archive dist
133
- if : matrix.sdist || env.archive_wheel
134
- uses : actions/upload-artifact@v3
135
+ - name : Archive sdist
136
+ if : matrix.sdist
137
+ uses : actions/upload-artifact@v4
138
+ with :
139
+ name : ${{ needs.pre-commit.outputs.dist-base }}-source
140
+ path : artifacts/src
141
+ compression-level : 0
142
+ - name : Archive wheel
143
+ if : env.archive_wheel
144
+ uses : actions/upload-artifact@v4
135
145
with :
136
- name : ${{ needs.pre-commit.outputs.dist-base }}
137
- path : artifacts
146
+ name : ${{ needs.pre-commit.outputs.dist-base }}-${{ env.OS_TAG }}-${{ matrix.python-version }}
147
+ path : artifacts/whl
148
+ compression-level : 0
138
149
139
150
windows :
140
151
name : Windows
@@ -170,13 +181,13 @@ jobs:
170
181
- name : Build wheel
171
182
run : |
172
183
python -m build -w
173
- mkdir -p "artifacts/${{ needs.pre-commit.outputs.dist-base }}"
174
- mv dist/*.whl "artifacts/${{ needs.pre-commit.outputs.dist-base }}"
184
+ mkdir -p "artifacts/whl/ ${{ needs.pre-commit.outputs.dist-base }}"
185
+ mv dist/*.whl "artifacts/whl/ ${{ needs.pre-commit.outputs.dist-base }}"
175
186
# save version-specific wheels and oldest abi3 wheel
176
187
python -c 'import sys
177
188
if sys.version_info < (3, 12): print("archive_wheel=1")' >> $GITHUB_ENV
178
189
- name : Install
179
- run : pip install artifacts/${{ needs.pre-commit.outputs.dist-base }}/*.whl
190
+ run : pip install artifacts/whl/ ${{ needs.pre-commit.outputs.dist-base }}/*.whl
180
191
- name : Run tests
181
192
# Reads OPENSLIDE_PATH
182
193
run : pytest -v
@@ -191,10 +202,11 @@ jobs:
191
202
run : python examples/deepzoom/deepzoom_tile.py --viewer -o tiled tests/fixtures/small.svs
192
203
- name : Archive wheel
193
204
if : env.archive_wheel
194
- uses : actions/upload-artifact@v3
205
+ uses : actions/upload-artifact@v4
195
206
with :
196
- name : ${{ needs.pre-commit.outputs.dist-base }}
197
- path : artifacts
207
+ name : ${{ needs.pre-commit.outputs.dist-base }}-windows-${{ matrix.python-version }}
208
+ path : artifacts/whl
209
+ compression-level : 0
198
210
199
211
docs :
200
212
name : Docs
@@ -214,7 +226,7 @@ jobs:
214
226
- name : Build
215
227
run : sphinx-build -d doctrees doc artifact/${{ needs.pre-commit.outputs.docs-base }}
216
228
- name : Archive
217
- uses : actions/upload-artifact@v3
229
+ uses : actions/upload-artifact@v4
218
230
with :
219
231
name : ${{ needs.pre-commit.outputs.docs-base }}
220
232
path : artifact
@@ -233,9 +245,10 @@ jobs:
233
245
id-token : write
234
246
steps :
235
247
- name : Download artifacts
236
- uses : actions/download-artifact@v3
248
+ uses : actions/download-artifact@v4
237
249
with :
238
- name : ${{ needs.pre-commit.outputs.dist-base }}
250
+ pattern : " ${{ needs.pre-commit.outputs.dist-base }}-*"
251
+ merge-multiple : true
239
252
- name : Release to PyPI
240
253
uses : pypa/gh-action-pypi-publish@release/v1
241
254
with :
0 commit comments