build: Update OpenUSD version to v26.03 #43
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build USD | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+*' | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| platform: windows_x64 | |
| variant: release | |
| variant_name: Release | |
| - os: windows-latest | |
| platform: windows_x64 | |
| variant: debug | |
| variant_name: Debug | |
| - os: ubuntu-22.04 | |
| platform: linux_x64 | |
| variant: release | |
| variant_name: Release | |
| - os: ubuntu-22.04 | |
| platform: linux_x64 | |
| variant: debug | |
| variant_name: Debug | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: PixarAnimationStudios/OpenUSD | |
| ref: v26.03 | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| ninja-build \ | |
| libgl1-mesa-dev \ | |
| libglu1-mesa-dev \ | |
| libx11-dev \ | |
| libxt-dev \ | |
| libxrandr-dev \ | |
| libxinerama-dev \ | |
| libxcursor-dev \ | |
| libxi-dev | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install python packages | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install PySide6 | |
| pip install PyOpenGL | |
| pip install jinja2 | |
| - name: Build (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| python build_scripts/build_usd.py ./Build/${{ matrix.variant_name }} --build-variant ${{ matrix.variant }} --toolset v143 --generator "Visual Studio 17 2022" --materialx --onetbb --draco --openimageio | |
| - name: Build (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| python build_scripts/build_usd.py ./Build/${{ matrix.variant_name }} --build-variant ${{ matrix.variant }} --generator Ninja --materialx --onetbb --draco --openimageio | |
| - name: Make cmake configs relocatable | |
| shell: pwsh | |
| run: | | |
| $buildPath = "${{ github.workspace }}/Build/${{ matrix.variant_name }}" | |
| $pythonPath = (python -c "import sys, os; print(os.path.dirname(sys.executable))") | |
| $files = @( | |
| "$buildPath/pxrConfig.cmake", | |
| "$buildPath/cmake/pxrTargets.cmake" | |
| ) | |
| $oiioConfig = "$buildPath/lib/cmake/OpenImageIO/OpenImageIOConfig.cmake" | |
| $oiioTargets = "$buildPath/lib/cmake/OpenImageIO/OpenImageIOTargets.cmake" | |
| if (Test-Path $oiioConfig) { $files += $oiioConfig } | |
| if (Test-Path $oiioTargets) { $files += $oiioTargets } | |
| foreach ($file in $files) { | |
| if (Test-Path $file) { | |
| $content = Get-Content $file -Raw | |
| # Replace build path (forward and back slashes) | |
| $fwd = ($buildPath -replace '\\', '/') | |
| $back = ($buildPath -replace '/', '\') | |
| $content = $content -replace [regex]::Escape($fwd), '${USD_BUILD_PATH}' | |
| $content = $content -replace [regex]::Escape($back), '${USD_BUILD_PATH}' | |
| # Replace Python path (forward and back slashes) | |
| $pyFwd = ($pythonPath -replace '\\', '/') | |
| $pyBack = ($pythonPath -replace '/', '\') | |
| $content = $content -replace [regex]::Escape($pyFwd), '${USD_PYTHON_PATH}' | |
| $content = $content -replace [regex]::Escape($pyBack), '${USD_PYTHON_PATH}' | |
| # Prepend variable definitions from environment | |
| $header = 'set(USD_BUILD_PATH "$ENV{USD_BUILD_PATH}")' + "`r`n" + 'set(USD_PYTHON_PATH "$ENV{USD_PYTHON_PATH}")' + "`r`n" | |
| $content = $header + $content | |
| Set-Content $file -Value $content -NoNewline | |
| Write-Output "Patched: $file" | |
| } | |
| } | |
| - name: Archive (Windows) | |
| if: runner.os == 'Windows' | |
| id: archive | |
| shell: pwsh | |
| run: | | |
| $tagName = & git describe --tags | |
| $version = $tagName.TrimStart("v") | |
| $archiveName = "Lumengine.USD_$version.${{ matrix.platform }}.py3.11_${{ matrix.variant_name }}.zip" | |
| echo "ARCHIVE_NAME=$archiveName" >> $env:GITHUB_OUTPUT | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/bin | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/cmake | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/include | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/lib | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/libraries | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/plugin | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/resources | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/share | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/CHANGELOG.md | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/LICENSE | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/pxrConfig.cmake | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/README.md | |
| 7z a "$archiveName" ${{github.workspace}}/Build/${{ matrix.variant_name }}/THIRD-PARTY.md | |
| - name: Archive (Linux) | |
| if: runner.os == 'Linux' | |
| id: archive-linux | |
| shell: bash | |
| run: | | |
| TAG=$(git describe --tags) | |
| VERSION=${TAG#v} | |
| ARCHIVE_NAME="Lumengine.USD_${VERSION}.${{ matrix.platform }}.py3.11_${{ matrix.variant_name }}.tar.gz" | |
| echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_OUTPUT | |
| tar -czvf "$ARCHIVE_NAME" -C Build/${{ matrix.variant_name }} \ | |
| bin cmake include lib libraries plugin resources share \ | |
| CHANGELOG.md LICENSE pxrConfig.cmake README.md THIRD-PARTY.md | |
| - name: Publish | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ steps.archive.outputs.ARCHIVE_NAME || steps.archive-linux.outputs.ARCHIVE_NAME }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |