Skip to content

Build bpy for Windows #15

Build bpy for Windows

Build bpy for Windows #15

Workflow file for this run

name: Build bpy for Windows
on:
workflow_dispatch:
inputs:
tag:
description: 'Blender Tag to build'
required: true
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout Blender repository recursively
uses: actions/checkout@v2
with:
repository: blender/blender
ref: ${{ github.event.inputs.tag }}
submodules: 'recursive'
path: blender
# - name: Set up Conda
# uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# python-version: 3.10.13
# activate-environment: bpy-env
# channels: conda-forge
# miniconda-version: "latest"
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.10.x'
# - name: Install Conda Dependencies
# run: |
# conda install -y cuda-toolkit setuptools -c "nvidia/label/cuda-12.3.1" -c conda-forge
# # find / -name nvcc
- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- name: Install Python
run: |
choco install python --version=3.10.11
- name: Install Visual Studio Community Edition
run: |
choco install visualstudio2022-workload-nativedesktop
- name: Install CUDA
run: |
choco install cuda
- name: Install TortoiseSVN and Command Line Client Tools
run: |
choco install tortoisesvn
- name: Install CMake
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
# - name: Add conda subdirectories to PATH
# run: |
# $condaSubDirs = Get-ChildItem "$env:CONDA\\pkgs" -Directory -Recurse | ForEach-Object { $_.FullName }
# foreach ($dir in $condaSubDirs) {
# echo "$dir" | Out-File -Append -FilePath $env:GITHUB_PATH
# }
- name: Add CUDA compilation flags
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: Set CUDA environment variables
# run: |
# $NVCC_PATH = Get-Command nvcc | Select-Object -ExpandProperty Source
# $CUDA_HOME = Split-Path (Split-Path $NVCC_PATH -Parent) -Parent
# echo "CUDA_HOME=$CUDA_HOME" | Out-File -Append -FilePath $env:GITHUB_ENV
# echo "CPLUS_INCLUDE_PATH=$CUDA_HOME\include;$env:CPLUS_INCLUDE_PATH" | Out-File -Append -FilePath $env:GITHUB_ENV
# echo "C_INCLUDE_PATH=$CUDA_HOME\include;$env:C_INCLUDE_PATH" | Out-File -Append -FilePath $env:GITHUB_ENV
- name: Cache Blender dependencies
uses: actions/cache@v2
with:
path: |
./lib
key: ${{ runner.os }}-blender-deps-${{ github.sha }}
restore-keys: |
${{ runner.os }}-blender-deps-
- name: Cache build files (for testing only)
uses: actions/cache@v2
with:
path: |
./build_windows_bpy
key: ${{ runner.os }}-blender-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-blender-build-
# - name: Setup terminal session
# uses: fawazahmed0/action-debug@main
# with:
# credentials: "user:p@ss!"
# Windows-specific dependency installation steps go here
# Install required software and libraries for building Blender on Windows
- name: Build Blender
run: |
cd blender
echo y| ./make.bat update
# ./make.bat bpy
shell: pwsh
# - name: Install Blender
# run: |
# $sitePackages = python -c "import site; print(site.getsitepackages()[0])"
# echo "SITE_PACKAGES=$sitePackages" | Out-File -Append -FilePath $env:GITHUB_ENV
# Copy-Item -Recurse .\build_windows_bpy\bin\bpy $env:SITE_PACKAGES
# - name: Make Wheel
# run: |
# python blender\build_files\utils\make_bpy_wheel.py .\build_windows_bpy\bin\
# - name: Upload Wheel as Artifact
# uses: actions/upload-artifact@v2
# with:
# name: bpy-windows
# path: |
# ./build_windows_bpy/bin/*.whl