4848 $ASSET_NAME = "usd-${usd_version}-${{ matrix.os }}.zip"
4949 $releaseExists = $false
5050 $stderr = $null
51+
5152 $releaseView = gh release view $releaseName 2>&1 | Tee-Object -Variable stderr
5253 if ($stderr -match "release not found") {
5354 $releaseExists = $false
5758 } else {
5859 $releaseExists = $true
5960 }
61+
6062 Write-Output "Release View result: $releaseName, Exists: $releaseExists"
6163 if ($releaseExists) {
6264 $assets = gh release view $releaseName --repo ${{ github.repository }} --json assets -q '.assets[].name'
@@ -108,6 +110,25 @@ jobs:
108110 run : |
109111 choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
110112
113+ - name : Initialize Visual Studio 2017 environment
114+ if : env.exists == 'false' && matrix.os == 'windows-2022'
115+ shell : pwsh
116+ run : |
117+ # Locate VS2017 installation path
118+ $vsPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version "[15.0,16.0)" -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
119+ if (!$vsPath) {
120+ Write-Error "Visual Studio 2017 not found."
121+ }
122+
123+ # Path to vcvarsall.bat
124+ $vcvarsall = Join-Path $vsPath 'VC\Auxiliary\Build\vcvarsall.bat'
125+ if (-Not (Test-Path $vcvarsall)) {
126+ Write-Error "vcvarsall.bat not found at $vcvarsall"
127+ }
128+
129+ # Initialize the environment
130+ cmd /c "`"$vcvarsall`" x64"
131+
111132 - name : Clone USD
112133 if : env.exists == 'false'
113134 run : git clone --branch v${{ env.USD_FORMATTED_VERSION }} --depth 1 https://github.com/PixarAnimationStudios/OpenUSD.git
@@ -134,11 +155,12 @@ jobs:
134155 $generator = "--generator Ninja"
135156
136157 if ("${{runner.os}}" -eq "Windows") {
137- $generator = '--generator "Visual Studio 17 2022 "'
158+ $generator = '--generator "Visual Studio 15 2017 "'
138159 $fileContent = Get-Content $file -Raw
139160 $fileContent = $fileContent -replace ' -- \{multiproc\}', ''
140161 Set-Content $file -Value $fileContent
141162 }
163+
142164 if ("${{runner.os}}" -eq "Linux") {
143165 $abi_arg = "--use-cxx11-abi 0"
144166 }
@@ -203,8 +225,9 @@ jobs:
203225 shell : pwsh
204226 run : |
205227 $ARTIFACT_PATH = "${{ github.workspace }}/usd-${{ github.event.inputs.usd_version }}-${{ matrix.os }}.zip"
228+
206229 if (-Not (Test-Path $ARTIFACT_PATH)) {
207- Write-Output "$ARTIFACT_PATH does not exist."
230+ Write-Output "$ARTIFACT_PATH does not exist."# Log Artifact Path and Rel
208231 }
209232 else {
210233 Write-Output "File $ARTIFACT_PATH exists."
@@ -213,6 +236,7 @@ jobs:
213236 }
214237 Write-Output "Uploading $ARTIFACT_PATH to USD-${{github.event.inputs.usd_version}}-Artifacts release..."
215238 gh release upload USD-${{ github.event.inputs.usd_version }}-Artifacts $ARTIFACT_PATH --repo ${{ github.repository }} --clobber
239+
216240 Write-Output "Upload successful."
217241 env :
218242 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments