@@ -211,6 +211,87 @@ jobs:
211
211
python -m twine check dist/*.tar.gz
212
212
python -m twine check dist/*.whl
213
213
214
+ docs :
215
+ name : Build documentation
216
+ needs : [build_wheels]
217
+ runs-on : ubuntu-22.04
218
+ steps :
219
+ - uses : actions/checkout@v4
220
+
221
+ - name : Set up Python
222
+ uses : actions/setup-python@v5
223
+ with :
224
+ python-version : " 3.9"
225
+
226
+ - name : Download data packages
227
+ uses : actions/download-artifact@v4
228
+ with :
229
+ path : ./data_packages/
230
+ pattern : " dist-basemap_data*"
231
+ merge-multiple : true
232
+
233
+ - name : Download basemap wheel for Linux
234
+ uses : actions/download-artifact@v4
235
+ with :
236
+ path : ./wheels/
237
+ pattern : " dist-basemap-wheels-ubuntu-*"
238
+ merge-multiple : true
239
+
240
+ - name : Install packages
241
+ run : |
242
+ # Get Python version.
243
+ IMPL=cp$(python -c "import sys; print('{0}{1}'.format(*sys.version_info[:2]))")
244
+
245
+ # Install basemap wheel matching current Python version.
246
+ WHEEL=$(find ./wheels -name "*-${IMPL}-${IMPL}*.whl" | head -1)
247
+ if [ -n "${WHEEL}" ]; then
248
+ python -m pip install "${WHEEL}"
249
+ else
250
+ echo "No matching wheel found for ${IMPL}-${IMPL}"
251
+ exit 1
252
+ fi
253
+
254
+ # Install basemap data packages.
255
+ python -m pip install ./data_packages/*.whl
256
+
257
+ - name : Install docs requirements
258
+ run : |
259
+ cd packages/basemap
260
+ python -m pip install -r requirements-doc.txt
261
+
262
+ - name : Run sphinx
263
+ run : |
264
+ cd packages/basemap
265
+ python -m sphinx doc/source public
266
+
267
+ - name : Upload docs artifacts
268
+ uses : actions/upload-artifact@v4
269
+ with :
270
+ name : docs
271
+ path : packages/basemap/public
272
+
273
+ - name : Upload github-pages artifact
274
+ uses : actions/upload-pages-artifact@v3
275
+ with :
276
+ name : github-pages
277
+ path : packages/basemap/public
278
+
279
+ pages :
280
+ name : Deploy documentation
281
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
282
+ needs : [docs, check]
283
+ runs-on : ubuntu-22.04
284
+ environment :
285
+ name : github-pages
286
+ url : ${{ steps.deployment.outputs.page_url }}
287
+ permissions :
288
+ pages : write
289
+ id-token : write
290
+ steps :
291
+ - name : Deploy github-pages
292
+ uses : actions/deploy-pages@v3
293
+ id : deployment
294
+
214
295
upload :
215
296
name : Upload packages
216
297
needs : [build_data, build_sdist, build_wheels, check]
0 commit comments