Skip to content

Commit fa731ec

Browse files
committed
Merge branch 'master' of github.com:lachlangrose/loopresources
2 parents 47fb31f + 47d0308 commit fa731ec

File tree

3 files changed

+181
-0
lines changed

3 files changed

+181
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: "📚 Build documentation and deploy "
2+
on:
3+
workflow_dispatch: # Able to not use cache by user demand
4+
inputs:
5+
cache:
6+
description: "Use build cache"
7+
required: false
8+
default: "true"
9+
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
USE_CACHE: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.cache == 'true') }}
17+
PYDEVD_DISABLE_FILE_VALIDATION: "1"
18+
PYTEST_ADDOPTS: "--color=yes"
19+
FORCE_COLOR: "True"
20+
21+
jobs:
22+
doc:
23+
name: Build Documentation
24+
runs-on: ubuntu-latest
25+
env:
26+
PYVISTA_OFF_SCREEN: "True"
27+
ALLOW_PLOTTING: true
28+
SHELLOPTS: "errexit:pipefail"
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.12"
35+
cache: "pip"
36+
37+
- uses: awalsh128/cache-apt-pkgs-action@v1.1.3
38+
with:
39+
packages: libosmesa6-dev libgl1-mesa-dev python3-tk pandoc git-restore-mtime
40+
version: 3.0
41+
42+
- name: Install PyVista and dependencies
43+
run: |
44+
pip install -e .[docs]
45+
46+
- name: Install custom OSMesa VTK variant
47+
run: |
48+
pip uninstall vtk -y
49+
pip install vtk-osmesa==9.3.0 --index-url https://gitlab.kitware.com/api/v4/projects/13/packages/pypi/simple
50+
51+
52+
53+
- name: Build Documentation
54+
run: make -C docs html
55+
56+
- name: Dump Sphinx Warnings and Errors
57+
if: always()
58+
run: if [ -e doc/sphinx_warnings.txt ]; then cat doc/sphinx_warnings.txt; fi
59+
60+
- name: Dump VTK Warnings and Errors
61+
if: always()
62+
run: if [ -e doc/errors.txt ]; then cat doc/errors.txt; fi
63+
64+
65+
66+
67+
68+
- name: Upload HTML documentation
69+
if: always()
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: docs-build
73+
path: docs/build/html/
74+
75+
- uses: actions/upload-artifact@v4
76+
with:
77+
name: examples
78+
path: docs/source/_auto_examples/
79+
80+
- name: Get Notebooks
81+
run: |
82+
mkdir _notebooks
83+
find docs/source/_auto_examples -type f -name '*.ipynb' | cpio -p -d -v _notebooks/
84+
85+
- uses: actions/upload-artifact@v4
86+
with:
87+
name: loopresources-notebooks
88+
path: _notebooks
89+
90+
- name: Deploy 🚀
91+
uses: JamesIves/github-pages-deploy-action@4.1.3
92+
with:
93+
branch: gh-pages # The branch the action should deploy to.
94+
folder: docs/build/html # The folder the action should deploy.
95+

.github/workflows/pypi.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "📦 PyPI "
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
make_sdist:
7+
name: Make SDist
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Build SDist
13+
run: |
14+
pip install build
15+
python -m build
16+
17+
- uses: actions/upload-artifact@v4
18+
with:
19+
name: dist
20+
path: dist/
21+
22+
upload_to_pypi:
23+
needs: ["make_sdist"]
24+
runs-on: "ubuntu-latest"
25+
26+
steps:
27+
- uses: actions/download-artifact@v4
28+
with:
29+
name: dist
30+
path: dist
31+
- uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
skip_existing: true
34+
verbose: true
35+
user: ${{ secrets.PYPI_USERNAME }}
36+
password: ${{ secrets.PYPI_PASSWORD }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
env:
6+
PACKAGE_NAME: loopresources
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
issues: write
11+
12+
name: release-please
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: GoogleCloudPlatform/release-please-action@v4
18+
id: release
19+
with:
20+
path: loopresources
21+
22+
outputs:
23+
release_created: ${{ steps.release.outputs.releases_created }}
24+
package:
25+
needs: release-please
26+
if: ${{ needs.release-please.outputs.release_created == 'true'}}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Trigger build for pypi and upload
30+
run: |
31+
curl -X POST \
32+
-H "Authorization: token ${{ secrets.GH_PAT }}" \
33+
-H "Accept: application/vnd.github.v3+json" \
34+
https://api.github.com/repos/Loop3d/${{env.PACKAGE_NAME}}/actions/workflows/pypi.yml/dispatches \
35+
-d '{"ref":"master"}'
36+
- name: Trigger build for conda and upload
37+
run: |
38+
curl -X POST \
39+
-H "Authorization: token ${{ secrets.GH_PAT }}" \
40+
-H "Accept: application/vnd.github.v3+json" \
41+
https://api.github.com/repos/Loop3d/${{env.PACKAGE_NAME}}/actions/workflows/conda.yml/dispatches \
42+
-d '{"ref":"master"}'
43+
44+
- name: Trigger build documentation
45+
run: |
46+
curl -X POST \
47+
-H "Authorization: token ${{ secrets.GH_PAT }}" \
48+
-H "Accept: application/vnd.github.v3+json" \
49+
https://api.github.com/repos/Loop3d/${{env.PACKAGE_NAME}}/actions/workflows/documentation.yml/dispatches \
50+
-d '{"ref":"master"}'

0 commit comments

Comments
 (0)