Skip to content

Merge pull request #38 from oumad/feat/twiki-ollama #53

Merge pull request #38 from oumad/feat/twiki-ollama

Merge pull request #38 from oumad/feat/twiki-ollama #53

Workflow file for this run

name: Windows Build
on:
push:
branches: [develop, main]
tags: ["*-prealpha"]
pull_request:
branches: [develop, main]
workflow_dispatch:
env:
USD_VERSION: "26.03"
USD_INSTALL_DIR: usd-install
BUILD_TYPE: RelWithDebInfo
jobs:
build-usd:
runs-on: windows-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.value }}
steps:
- name: Compute cache key
id: cache-key
shell: pwsh
run: |
$vsVer = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationVersion
echo "value=usd-windows-${{ env.USD_VERSION }}-vs${vsVer}" >> $env:GITHUB_OUTPUT
- name: Cache USD
id: cache-usd
uses: actions/cache@v5
with:
path: ${{ env.USD_INSTALL_DIR }}
key: ${{ steps.cache-key.outputs.value }}
- name: Install Python Jinja2
if: steps.cache-usd.outputs.cache-hit != 'true'
run: pip install jinja2
- name: Checkout OpenUSD ${{ env.USD_VERSION }}
if: steps.cache-usd.outputs.cache-hit != 'true'
uses: actions/checkout@v5
with:
repository: PixarAnimationStudios/OpenUSD
ref: v${{ env.USD_VERSION }}
path: OpenUSD
fetch-depth: 1
- name: Build USD
if: steps.cache-usd.outputs.cache-hit != 'true'
shell: pwsh
env:
# CMake 4 on windows-latest dropped support for cmake_minimum_required < 3.5,
# which OpenUSD's bundled dependencies (e.g. zlib 1.2.13) still declare.
# build_usd.py passes this env var down to every nested dependency configure.
CMAKE_POLICY_VERSION_MINIMUM: "3.5"
run: |
python OpenUSD/build_scripts/build_usd.py `
--embree --alembic `
--no-python --no-usdview `
--no-examples --no-tutorials --no-docs `
--build-variant release `
${{ github.workspace }}/${{ env.USD_INSTALL_DIR }}
- name: Remove USD build artifacts from install dir
if: steps.cache-usd.outputs.cache-hit != 'true'
shell: pwsh
run: Remove-Item -Recurse -Force "${{ github.workspace }}/${{ env.USD_INSTALL_DIR }}/build"
build-usdtweak:
runs-on: windows-latest
needs: build-usd
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Restore USD cache
uses: actions/cache/restore@v5
with:
path: ${{ env.USD_INSTALL_DIR }}
key: ${{ needs.build-usd.outputs.cache-key }}
- name: Configure
shell: pwsh
run: |
# Let CMake auto-detect the Visual Studio generator (the runner image's
# latest VS) so the usdtweak toolset matches the one build_usd.py picked
# for USD. Pinning a specific VS version breaks when the image upgrades.
cmake `
"-Dpxr_DIR=${{ github.workspace }}/${{ env.USD_INSTALL_DIR }}" `
"-DCMAKE_PREFIX_PATH=${{ github.workspace }}/${{ env.USD_INSTALL_DIR }}" `
-DBUILD_TWIKI=ON `
-B build
if ($LASTEXITCODE -ne 0) { exit 1 }
- name: Build
shell: pwsh
run: |
cmake --build build --config ${{ env.BUILD_TYPE }} --parallel
if ($LASTEXITCODE -ne 0) { exit 1 }
- name: Install NSIS
run: choco install nsis --yes
- name: Package (CPack NSIS)
working-directory: build
shell: pwsh
run: |
cpack -G NSIS -C ${{ env.BUILD_TYPE }}
if ($LASTEXITCODE -ne 0) { exit 1 }
- name: Upload installer artifact
uses: actions/upload-artifact@v5
with:
name: usdtweak-windows-installer
path: build/usdtweak-*.exe
release:
runs-on: ubuntu-latest
needs: build-usdtweak
if: (startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '-prealpha')) || github.event_name == 'workflow_dispatch'
steps:
- name: Download installer artifact
uses: actions/download-artifact@v5
with:
name: usdtweak-windows-installer
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: "*.exe"
draft: true
prerelease: true