Skip to content

Build bpy for Windows #33

Build bpy for Windows

Build bpy for Windows #33

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: test batch file
run: |
echo "PYTHON=C:\hostedtoolcache\windows\Python\3.10.11\x64\python.exe" | Out-File -Append -FilePath $env:GITHUB_ENV
(echo %PYTHON%) >test.bat
# type file.txt >>file.txt.new
# move /y file.txt.new file.txt
./test.bat
# - name: Checkout Blender repository recursively
# uses: actions/checkout@v2
# with:
# repository: blender/blender
# ref: ${{ github.event.inputs.tag }}
# submodules: 'recursive'
# path: blender
# - name: Install Chocolatey
# run: |
# Set-ExecutionPolicy Bypass -Scope Process -Force
# Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10.11'
# - name: Install Visual Studio Community Edition
# run: |
# choco install visualstudio2022-workload-nativedesktop
# - name: Install CUDA
# run: |
# choco install cuda
# Add-Content $env:GITHUB_PATH "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin"
# - 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 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: Refresh env
# # run: |
# # refreshenv
# - 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: Set Python Path
# run: |
# chcp 65001 #set code page to utf-8
# echo "PYTHON=C:\hostedtoolcache\windows\Python\3.10.11\x64\python.exe" >> $env:GITHUB_ENV
# - name: Run make.bat
# run: |
# cd blender
# echo y | .\make.bat update
# # set "Python=C:\hostedtoolcache\windows\Python\3.10.11\x64\python.exe" && echo y | .\make.bat bpy
# # - 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