Fix the Navigation Mesh component export for Blender 4.2 #451
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Python Linter | |
uses: weibullguy/[email protected] | |
with: | |
python-root-list: "addons" | |
use-black: false | |
use-yapf: false | |
use-isort: false | |
use-docformatter: false | |
use-pycodestyle: true | |
use-autopep8: false | |
use-pydocstyle: false | |
use-mypy: false | |
use-pylint: false | |
use-flake8: false | |
use-mccabe: false | |
use-radon: false | |
use-rstcheck: false | |
use-check-manifest: false | |
use-pyroma: false | |
extra-black-options: "" | |
extra-yapf-options: "" | |
extra-isort-options: "" | |
extra-docformatter-options: "" | |
# This should work with **/models but it doesn't | |
extra-pycodestyle-options: "--exclude=models --ignore=E501,W504" | |
extra-pydocstyle-options: "" | |
extra-mypy-options: "" | |
extra-pylint-options: "" | |
extra-flake8-options: "" | |
extra-mccabe-options: "" | |
extra-radon-options: "" | |
extra-rstcheck-options: "" | |
extra-manifest-options: "" | |
extra-pyroma-options: "" | |
test: | |
needs: lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: ["3.5.0", "3.4.0", "3.3.1", "2.93.9"] | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
# Finds latest Blender build, and outputs the hosted build's download URL. | |
- name: Find latest Blender build | |
id: blender_version | |
run: | | |
echo ${{ matrix.version }} | |
major=$(echo ${{ matrix.version }} | cut -d. -f1) | |
minor=$(echo ${{ matrix.version }} | cut -d. -f2) | |
patch=$(echo ${{ matrix.version }} | cut -d. -f3) | |
echo "Looking for Blender $BLENDER_MAJOR.$BLENDER_MINOR.${BLENDER_PATCH}" | |
BLENDER_URL="https://download.blender.org/release/Blender$major.$minor/blender-$major.$minor.$patch-linux-x64.tar.xz" | |
echo "blender-url=$BLENDER_URL" >> $GITHUB_OUTPUT | |
# Loads a cached build of Blender if available. If not available, this step | |
# enqueues the /opt/blender directory to be cached after tests pass. | |
- id: blender_cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-blender | |
with: | |
path: /opt/blender | |
key: ${{ steps.blender_version.outputs.blender-url }} | |
# Downloads a build from blender.org, if a cached version was not available. | |
- name: Download Blender | |
if: ${{ !steps.blender_cache.outputs.cache-hit }} | |
run: | | |
mkdir /opt/blender | |
echo "Downloading: ${{ steps.blender_version.outputs.blender-url }}" | |
curl -SL "${{ steps.blender_version.outputs.blender-url }}" | \ | |
tar -Jx -C /opt/blender --strip-components=1 | |
- name: Set up workspace | |
run: | | |
sudo ln -s /opt/blender/blender /usr/local/bin/blender | |
blender --version | |
major=$(echo ${{ matrix.version }} | cut -d. -f1) | |
minor=$(echo ${{ matrix.version }} | cut -d. -f2) | |
ADDON_DIR=/opt/blender/$major.$minor/scripts/addons | |
rm -rf $ADDON_DIR/io_hubs_addon | |
cp -r addons/io_hubs_addon $ADDON_DIR | |
cd tests | |
yarn install | |
mkdir -p out | |
- name: Run tests | |
run: | | |
cd tests | |
OUT_PREFIX=$GITHUB_WORKSPACE/tests/out yarn test-bail --reporter-options reportDir=out/mochawesome | |
- name: Upload test artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-output-${{ matrix.version }} | |
path: tests/out/mochawesome | |
if-no-files-found: error | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update build number | |
run: | | |
sed -i'' 's/"dev_build"/${{ github.run_number }}/g' $GITHUB_WORKSPACE/addons/io_hubs_addon/__init__.py | |
- name: Get version | |
id: get_version | |
run: | | |
VERSION=$(grep '"version"' $GITHUB_WORKSPACE/addons/io_hubs_addon/__init__.py | sed -E 's/.*\(([0-9]+), ([0-9]+), ([0-9]+), ([0-9]+)\).*/\1.\2.\3.\4/') | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Upload addon artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: io_hubs_addon_${{ steps.get_version.outputs.version }} | |
path: addons | |
if-no-files-found: error |