Skip to content

Merge pull request #5162 from nortikin/snap_curves #207

Merge pull request #5162 from nortikin/snap_curves

Merge pull request #5162 from nortikin/snap_curves #207

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