Skip to content

Commit

Permalink
wip: build from python script
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgold committed Jan 8, 2024
1 parent 2146059 commit 52a7c09
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 43 deletions.
91 changes: 49 additions & 42 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ jobs:
run: |
nvcc --version
"set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL '' FORCE)" | Out-File -Append -FilePath ./blender/build_files/cmake/config/bpy_module.cmake
- name: Build Blender
run: |
python workspace/build_blender.py build --tag ${{ env.TAG }} --install --publish
env:
GITHUB_TOKEN: ${{ github.token }}


# - name: Set CUDA environment variables
# run: |
Expand Down Expand Up @@ -336,18 +343,18 @@ jobs:
run: |
Get-ChildItem Env:
- name: Extract Blender Major Version Number
id: version_extraction
run: |
python -c "import sys; version_tag = sys.argv[1].lstrip('v'); parts = version_tag.split('.'); major_version = '.'.join(parts[:2]); print(f'MAJOR_VERSION={major_version}')" "${{ env.TAG }}" >> $GITHUB_ENV
shell: bash
# - name: Extract Blender Major Version Number
# id: version_extraction
# run: |
# python -c "import sys; version_tag = sys.argv[1].lstrip('v'); parts = version_tag.split('.'); major_version = '.'.join(parts[:2]); print(f'MAJOR_VERSION={major_version}')" "${{ env.TAG }}" >> $GITHUB_ENV
# shell: bash

- name: Download Precompiled Binaries for the Release
run: |
mkdir lib
cd lib
svn checkout https://svn.blender.org/svnroot/bf-blender/tags/blender-${{ env.MAJOR_VERSION }}-release/lib/win64_vc15
shell: cmd
# - name: Download Precompiled Binaries for the Release
# run: |
# mkdir lib
# cd lib
# svn checkout https://svn.blender.org/svnroot/bf-blender/tags/blender-${{ env.MAJOR_VERSION }}-release/lib/win64_vc15
# shell: cmd

# - name: Download Blender Python API Stubs
# id: download-artifact
Expand All @@ -358,40 +365,40 @@ jobs:
# name: blender-python-api-stubs-${{ env.TAG }}
# path: ./build_windows_Bpy_x64_vc17_Release/bin/

- name: Download Blender Python API Stubs
id: download-artifact
uses: actions/download-artifact@v4
with:
name: blender-python-api-stubs-${{ env.TAG }}
path: ./build_windows_Bpy_x64_vc17_Release/bin/
# - name: Download Blender Python API Stubs
# id: download-artifact
# uses: actions/download-artifact@v4
# with:
# name: blender-python-api-stubs-${{ env.TAG }}
# path: ./build_windows_Bpy_x64_vc17_Release/bin/

- name: Build Blender
run: |
cd blender
yes| make update
make bpy
shell: cmd
# - name: Build Blender
# run: |
# cd blender
# yes| make update
# make bpy
# shell: cmd


- name: Make Wheel
run: |
pip install -U pip setuptools wheel
copy ./workspace/make_bpy_wheel.py ./blender/build_files/utils/
python blender\build_files\utils\make_bpy_wheel.py .\build_windows_Bpy_x64_vc17_Release\bin\
# - name: Upload Wheel as Artifact
# uses: actions/upload-artifact@v2
# with:
# name: bpy-windows
# path: |
# ./build_windows_Bpy_x64_vc17_Release/bin/*.whl
# - name: Make Wheel
# run: |
# pip install -U pip setuptools wheel
# copy ./workspace/make_bpy_wheel.py ./blender/build_files/utils/
# python blender\build_files\utils\make_bpy_wheel.py .\build_windows_Bpy_x64_vc17_Release\bin\
# # - name: Upload Wheel as Artifact
# # uses: actions/upload-artifact@v2
# # with:
# # name: bpy-windows
# # path: |
# # ./build_windows_Bpy_x64_vc17_Release/bin/*.whl

- name: Install Dependencies
run: |
python -m pip install --upgrade pip ndg-httpsclient pyopenssl pyasn1
pip install -r requirements.txt
# - name: Install Dependencies
# run: |
# python -m pip install --upgrade pip ndg-httpsclient pyopenssl pyasn1
# pip install -r requirements.txt


- name: Publish Wheel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python workspace/build_blender.py publish-github ${{ env.TAG }} ./build_windows_Bpy_x64_vc17_Release/bin/
# - name: Publish Wheel
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: python workspace/build_blender.py publish-github ${{ env.TAG }} ./build_windows_Bpy_x64_vc17_Release/bin/
3 changes: 2 additions & 1 deletion workspace/build_blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,9 @@ def build(tag: str = typer.Option(None, help="Specific tag to check out"), clear
svnpath = f"https://svn.blender.org/svnroot/bf-blender/tags/blender-{major_version}-release/lib/linux_x86_64_glibc_228/"
subprocess.run(["svn", "checkout", svnpath], cwd=lib_dir)
elif os_type == "Windows":

build_dir = Path.cwd() / "../build_windows_Bpy_x64_vc17_Release/bin/"
svnpath = f"https://svn.blender.org/svnroot/bf-blender/tags/blender-{major_version}--release/lib/win64_vc15"
subprocess.run(["svn", "checkout", svnpath], cwd=lib_dir)
elif os_type == "Darwin": # MacOS
build_dir = Path.cwd() / "../build_darwin_bpy"
else:
Expand Down

0 comments on commit 52a7c09

Please sign in to comment.