-
Notifications
You must be signed in to change notification settings - Fork 233
106 lines (92 loc) · 3.16 KB
/
apidocs_builder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Build API documentation
on:
push:
branches: 'master'
paths:
- 'utils/**'
- 'core/**'
- '*.py'
- '.github/workflows/apidocs_builder.yml'
# pull_request:
# branches: [ master ]
# paths:
# - 'utils/**'
# - 'core/**'
# - '*.py'
# - '.github/workflows/apidocs_builder.yml'
jobs:
build:
runs-on: ubuntu-latest
env:
blender_version: "3.6.16"
major_blender_version: "3.6"
python_version: "3.10"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{env.python_version}}
uses: actions/setup-python@v5
with:
python-version: ${{env.python_version}}
- name: Cache
uses: actions/cache@v4
with:
path: ./installation
key: blender-${{ env.blender_version }}-${{ hashFiles('.github/workflows/apidocs_builder.yml') }}
- name: Install Blender
run: |
# echo "starting run"
BLENDER_VERSION=${{env.blender_version}}
MAJOR_BLENDER_VERSION=${{env.major_blender_version}}
BLENDER_URL=https://mirrors.de.sahilister.net/blender/release/Blender3.6/blender-3.6.16-linux-x64.tar.xz
SVERCHOK_DIR=scripts/addons/sverchok
BLENDER_TAR=$(basename $BLENDER_URL)
BLENDER_DIR=$(basename $BLENDER_URL .tar.xz)
RELEASE=blender3616_LTS
if [ ! -f installation/blender/blender ]
then
mkdir -p installation
cd installation
# not verbose, but not quiet.
wget -nv $BLENDER_URL
# unpack this tar to a known name
mkdir $RELEASE
tar xf $BLENDER_TAR -C $RELEASE --strip-components 1
rm $BLENDER_TAR
mv $RELEASE blender
pushd blender/
PYTHON=${MAJOR_BLENDER_VERSION}/python/bin/python${{env.python_version}}
$PYTHON -m ensurepip
$PYTHON -m pip install --upgrade pip setuptools wheel
$PYTHON -m pip install --upgrade scipy geomdl scikit-image
$PYTHON -m pip install --upgrade pdoc3
popd
cd ..
fi
#mkdir -p ${PWD}/installation/blender/${BLENDER_VERSION}/${SVERCHOK_DIR}
ln -s ${PWD} ${PWD}/installation/blender/${MAJOR_BLENDER_VERSION}/${SVERCHOK_DIR}
mkdir -p ~/.config/blender/${MAJOR_BLENDER_VERSION}/config/
ln -s ${PWD}/tests/references/userpref.blend ~/.config/blender/${MAJOR_BLENDER_VERSION}/config/
- name: Checkout master
uses: actions/checkout@master
with:
path: 'master'
- name: Checkout gh-pages
uses: actions/checkout@master
with:
path: 'gh_pages'
ref: 'gh-pages'
- name: Generate API documentation
run: |
bash ./generate_api_documentation.sh -o "${GITHUB_WORKSPACE}/gh_pages/apidocs"
env:
BLENDER: |
./installation/blender/blender-softwaregl
- name: Push changes in gh-pages
run: |
cd "${GITHUB_WORKSPACE}/gh_pages"
date > generated.txt
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "update API documentation bot"
git push