From 9950ad01c05fe6ec8fe62513ea03e7d7ecc400d9 Mon Sep 17 00:00:00 2001 From: monkeyman192 Date: Tue, 26 May 2026 17:13:17 +1000 Subject: [PATCH 1/2] Start working on CI fix --- .github/workflows/pipeline.yml | 49 ++++++++++++++++++++++------------ get_version.py | 4 +++ 2 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 get_version.py diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 1e99096..54b3f06 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -17,34 +17,49 @@ jobs: outputs: nmsdk_version: ${{ steps.get_nmsdk_version.outputs.version }} steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.9 - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - name: Set up Python 3.11 + uses: actions/setup-python@v6 with: - python-version: "3.9" + python-version: "3.11" - name: Install dependencies run: python -m pip install flake8 mkdocs - name: Build docs run: mkdocs build - # TODO: This needs to be fixed. Probably pull blenderkit/headless-blender:blender-5.0 and use it for building... - - name: Build release + - name: Install blender run: | - python ./tools/build.py - Expand-Archive build/nmsdk.zip -DestinationPath ./nmsdk + BLENDER_EXACT_VERSION="5.1.2" + BLENDER_GENERAL_VERSION="5.1" + BLENDER_ARCHIVE="blender-${BLENDER_EXACT_VERSION}-windows-x64.zip" + BLENDER_URL="https://download.blender.org/release/Blender${BLENDER_GENERAL_VERSION}/${BLENDER_ARCHIVE}" + curl -L ${BLENDER_URL} -o ${BLENDER_ARCHIVE} + unzip -qq ${BLENDER_ARCHIVE} + mv blender-${BLENDER_EXACT_VERSION}-windows-x64 blender + ls blender + shell: bash + - name: Build release + run: ./blender/blender.exe --command extension build --source-dir "src\addon\nmsdk" - name: Get NMSDK tag version id: get_nmsdk_version - run: echo "version=$(Tools/read_nmsdk_version.sh)" >> $GITHUB_OUTPUT + run: | + VERSION=$(python get_version.py) + echo $VERSION + echo "version=$VERSION" >> $GITHUB_OUTPUT shell: bash + - name: TEST + run: | + echo $VERSION + echo "${{ steps.get_nmsdk_version.outputs.version }}" - name: Upload plugin zip for release - uses: actions/upload-artifact@v4 - with: - name: NMSDK - path: nmsdk - - name: Upload website for release - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: - name: NMSDK_site - path: html_docs/* + path: nmsdk-${{ steps.get_nmsdk_version.outputs.version }}.zip + archive: false + # - name: Upload website for release + # uses: actions/upload-artifact@v7 + # with: + # name: NMSDK_site + # path: html_docs/* release: name: Release NMSDK zip and publish docs # Only run this job if the commit was tagged. diff --git a/get_version.py b/get_version.py new file mode 100644 index 0000000..9ba3a50 --- /dev/null +++ b/get_version.py @@ -0,0 +1,4 @@ +import tomllib + +with open("src/addon/nmsdk/blender_manifest.toml", "rb") as f: + print(tomllib.load(f)["version"]) From 76f1323fc80dca781d77337dc7562371d6c79c83 Mon Sep 17 00:00:00 2001 From: monkeyman192 Date: Wed, 10 Jun 2026 10:45:56 +1000 Subject: [PATCH 2/2] Further changes for pipelines --- .github/workflows/pipeline.yml | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 54b3f06..e3b20a2 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -41,18 +41,12 @@ jobs: run: ./blender/blender.exe --command extension build --source-dir "src\addon\nmsdk" - name: Get NMSDK tag version id: get_nmsdk_version - run: | - VERSION=$(python get_version.py) - echo $VERSION - echo "version=$VERSION" >> $GITHUB_OUTPUT + run: echo "version=$(python get_version.py)" >> $GITHUB_OUTPUT shell: bash - - name: TEST - run: | - echo $VERSION - echo "${{ steps.get_nmsdk_version.outputs.version }}" - name: Upload plugin zip for release uses: actions/upload-artifact@v7 with: + name: NMSDK_plugin path: nmsdk-${{ steps.get_nmsdk_version.outputs.version }}.zip archive: false # - name: Upload website for release @@ -70,28 +64,21 @@ jobs: VERSION: ${{ needs.build.outputs.nmsdk_version }} steps: - name: Download files for release - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: - name: NMSDK + name: NMSDK_plugin + skip-decompress: true - name: Get tagged version run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV shell: bash - name: Upload resources if version matches if: env.VERSION == env.TAG - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: name: "${{ env.TAG }}" tag_name: ${{ env.TAG }} - prerelease: false + prerelease: ${{ contains(env.VERSION, 'alpha') }} files: nmsdk.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # TODO: Also upload site. - - name: Check if tag doesn't match version - if: env.VERSION != env.TAG - run: | - echo "There is a version mismatch between the tag and NMSDK version!" - echo "NMSDK version: ${{ env.VERSION }}" - echo "Tag version: ${{ env.TAG }}" - exit 1 - shell: bash