Skip to content

Commit 80476d7

Browse files
committed
add doc building
1 parent 76ed633 commit 80476d7

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.github/workflows/build.yml

+85
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,91 @@ jobs:
250250
exit 1
251251
fi
252252
253+
docs:
254+
name: Build documentation
255+
needs: [build_wheels]
256+
runs-on: ubuntu-22.04
257+
steps:
258+
- uses: actions/checkout@v4
259+
260+
- name: Set up Python
261+
uses: actions/setup-python@v5
262+
with:
263+
python-version: "3.9"
264+
265+
- name: Download basemap wheel for Linux
266+
uses: actions/download-artifact@v4
267+
with:
268+
name: dist-basemap-wheels-ubuntu-22.04
269+
path: ./wheels/
270+
271+
- name: Download data packages
272+
uses: actions/download-artifact@v4
273+
with:
274+
pattern: dist-basemap_data*
275+
path: ./data_packages/
276+
merge-multiple: true
277+
278+
- name: Install packages
279+
run: |
280+
# Get Python version to find matching wheel
281+
PYTHON_VERSION=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
282+
echo "Using Python $PYTHON_VERSION"
283+
284+
# Install matching wheel for Linux
285+
MATCHING_WHEEL=$(find ./wheels -name "basemap-*-cp3${PYTHON_VERSION/./}*.whl" | head -1)
286+
if [ -n "$MATCHING_WHEEL" ]; then
287+
echo "Installing wheel: $MATCHING_WHEEL"
288+
python -m pip install "$MATCHING_WHEEL"
289+
else
290+
echo "No matching wheel found for Python $PYTHON_VERSION. Available wheels:"
291+
ls -la ./wheels/
292+
echo "Falling back to installing any available wheel..."
293+
python -m pip install ./wheels/*.whl
294+
fi
295+
296+
# Install data packages
297+
echo "Installing data packages..."
298+
python -m pip install ./data_packages/*.whl
299+
300+
- name: Install documentation requirements
301+
run: |
302+
cd packages/basemap
303+
python -m pip install -r requirements-doc.txt
304+
305+
- name: Build documentation
306+
run: |
307+
cd packages/basemap
308+
python -m sphinx doc/source public
309+
310+
- name: Upload docs artifacts
311+
uses: actions/upload-artifact@v4
312+
with:
313+
name: docs-artifact
314+
path: packages/basemap/public
315+
316+
- name: Upload github-pages artifact
317+
uses: actions/upload-pages-artifact@v3
318+
with:
319+
name: github-pages
320+
path: packages/basemap/public
321+
322+
pages:
323+
name: Deploy documentation
324+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
325+
needs: [docs, check]
326+
runs-on: ubuntu-22.04
327+
environment:
328+
name: github-pages
329+
url: ${{ steps.deployment.outputs.page_url }}
330+
permissions:
331+
pages: write
332+
id-token: write
333+
steps:
334+
- name: Deploy github-pages
335+
uses: actions/deploy-pages@v3
336+
id: deployment
337+
253338
upload:
254339
name: Upload packages
255340
needs: [build_data, build_sdist, build_wheels, check]

0 commit comments

Comments
 (0)