@@ -297,12 +297,76 @@ if (-not $cpuBuild) {
297297 exit 1
298298}
299299
300- # Build GPU version with Vulkan
301- Write-Step " Building GPU version (Vulkan acceleration)..."
302- $gpuBuild = Build-WindowsVariant - Variant " gpu" - Features " gpu-windows"
303- if (-not $gpuBuild ) {
304- Write-Error " Failed to build GPU version"
305- exit 1
300+ # Check for Vulkan SDK before attempting GPU build
301+ Write-Step " Checking for Vulkan SDK for GPU build..."
302+ $CanBuildGPU = $false
303+ $VulkanSDKFound = $false
304+
305+ # Check VULKAN_SDK environment variable
306+ if ($env: VULKAN_SDK ) {
307+ if (Test-Path $env: VULKAN_SDK ) {
308+ Write-Success " Vulkan SDK found at: $env: VULKAN_SDK "
309+ $VulkanSDKFound = $true
310+
311+ # Check for vulkan-1.lib
312+ $VulkanLib = Join-Path $env: VULKAN_SDK " Lib\vulkan-1.lib"
313+ if (Test-Path $VulkanLib ) {
314+ Write-Success " vulkan-1.lib found"
315+ $CanBuildGPU = $true
316+ } else {
317+ Write-Warning " vulkan-1.lib not found at expected location: $VulkanLib "
318+ }
319+
320+ # Optional: Check for vulkaninfo tool
321+ $VulkanInfo = Join-Path $env: VULKAN_SDK " Bin\vulkaninfo.exe"
322+ if (Test-Path $VulkanInfo ) {
323+ Write-Info " vulkaninfo tool available for testing"
324+ }
325+ } else {
326+ Write-Warning " VULKAN_SDK environment variable set but path does not exist: $env: VULKAN_SDK "
327+ }
328+ } else {
329+ Write-Warning " VULKAN_SDK environment variable not set"
330+ }
331+
332+ # Alternative: Check common Vulkan SDK installation paths
333+ if (-not $VulkanSDKFound ) {
334+ $CommonPaths = @ (
335+ " C:\VulkanSDK" ,
336+ " $env: ProgramFiles \VulkanSDK" ,
337+ " $env: LOCALAPPDATA \VulkanSDK"
338+ )
339+
340+ foreach ($BasePath in $CommonPaths ) {
341+ if (Test-Path $BasePath ) {
342+ $SDKVersions = Get-ChildItem - Path $BasePath - Directory | Sort-Object Name - Descending
343+ if ($SDKVersions.Count -gt 0 ) {
344+ $LatestSDK = $SDKVersions [0 ].FullName
345+ Write-Info " Found Vulkan SDK at: $LatestSDK "
346+ Write-Warning " Please set VULKAN_SDK environment variable to: $LatestSDK "
347+ break
348+ }
349+ }
350+ }
351+ }
352+
353+ # Build GPU version with Vulkan if SDK is available
354+ if ($CanBuildGPU ) {
355+ Write-Step " Building GPU version (Vulkan acceleration)..."
356+ $gpuBuild = Build-WindowsVariant - Variant " gpu" - Features " gpu-windows"
357+ if (-not $gpuBuild ) {
358+ Write-Error " Failed to build GPU version"
359+ Write-Warning " Continuing with CPU-only release..."
360+ $gpuBuild = $null
361+ }
362+ } else {
363+ Write-Warning " Skipping GPU build - Vulkan SDK not found or not properly configured"
364+ Write-Warning " To build GPU version:"
365+ Write-Warning " 1. Download and install Vulkan SDK from: https://vulkan.lunarg.com/sdk/home"
366+ Write-Warning " 2. Set VULKAN_SDK environment variable to the SDK installation path"
367+ Write-Warning " 3. Restart PowerShell and run this script again"
368+ Write-Info " Continuing with CPU-only release..."
369+ $gpuBuild = $null
306370}
307371
308372# Download and update latest.json
@@ -367,21 +431,26 @@ try {
367431 Write-Success " Uploaded: $ ( Split-Path $cpuBuild.SignatureFile - Leaf) "
368432 }
369433
370- # Upload GPU installer
371- Write-Info " Uploading GPU installer..."
372- gh release upload $ReleaseTag $gpuBuild.Installer -- clobber
373- Write-Success " Uploaded: $ ( Split-Path $gpuBuild.Installer - Leaf) "
374-
375- # Upload GPU update zip
376- Write-Info " Uploading GPU update archive..."
377- gh release upload $ReleaseTag $gpuBuild.UpdateZip -- clobber
378- Write-Success " Uploaded: $ ( Split-Path $gpuBuild.UpdateZip - Leaf) "
379-
380- # Upload GPU signature if it exists
381- if ($gpuBuild.SignatureFile ) {
382- Write-Info " Uploading GPU signature..."
383- gh release upload $ReleaseTag $gpuBuild.SignatureFile -- clobber
384- Write-Success " Uploaded: $ ( Split-Path $gpuBuild.SignatureFile - Leaf) "
434+ # Upload GPU artifacts if build succeeded
435+ if ($gpuBuild ) {
436+ # Upload GPU installer
437+ Write-Info " Uploading GPU installer..."
438+ gh release upload $ReleaseTag $gpuBuild.Installer -- clobber
439+ Write-Success " Uploaded: $ ( Split-Path $gpuBuild.Installer - Leaf) "
440+
441+ # Upload GPU update zip
442+ Write-Info " Uploading GPU update archive..."
443+ gh release upload $ReleaseTag $gpuBuild.UpdateZip -- clobber
444+ Write-Success " Uploaded: $ ( Split-Path $gpuBuild.UpdateZip - Leaf) "
445+
446+ # Upload GPU signature if it exists
447+ if ($gpuBuild.SignatureFile ) {
448+ Write-Info " Uploading GPU signature..."
449+ gh release upload $ReleaseTag $gpuBuild.SignatureFile -- clobber
450+ Write-Success " Uploaded: $ ( Split-Path $gpuBuild.SignatureFile - Leaf) "
451+ }
452+ } else {
453+ Write-Warning " GPU build was skipped - no GPU artifacts to upload"
385454 }
386455
387456 # Upload updated latest.json
@@ -405,11 +474,13 @@ Get-ChildItem $OutputDir -Filter "*_x64-setup*" | ForEach-Object {
405474 $size = if ($_.Length -gt 1 MB ) { " {0:N2} MB" -f ($_.Length / 1 MB ) } else { " {0:N2} KB" -f ($_.Length / 1 KB ) }
406475 Write-Host " $ ( $_.Name ) ($size )" - ForegroundColor White
407476}
408- Write-Host " "
409- Write-Info " GPU Version (Vulkan Acceleration):" - ForegroundColor Cyan
410- Get-ChildItem $OutputDir - Filter " *gpu*" | ForEach-Object {
411- $size = if ($_.Length -gt 1 MB ) { " {0:N2} MB" -f ($_.Length / 1 MB ) } else { " {0:N2} KB" -f ($_.Length / 1 KB ) }
412- Write-Host " $ ( $_.Name ) ($size )" - ForegroundColor White
477+ if ($gpuBuild ) {
478+ Write-Host " "
479+ Write-Info " GPU Version (Vulkan Acceleration):" - ForegroundColor Cyan
480+ Get-ChildItem $OutputDir - Filter " *gpu*" | ForEach-Object {
481+ $size = if ($_.Length -gt 1 MB ) { " {0:N2} MB" -f ($_.Length / 1 MB ) } else { " {0:N2} KB" -f ($_.Length / 1 KB ) }
482+ Write-Host " $ ( $_.Name ) ($size )" - ForegroundColor White
483+ }
413484}
414485
415486Write-Host " "
@@ -424,13 +495,23 @@ if ($HasSigningKey) {
424495Write-Host " "
425496Write-Info " 📋 Build Information:"
426497Write-Host " • CPU Version: Works on ALL Windows 10/11 systems" - ForegroundColor Green
427- Write-Host " • GPU Version: Requires Vulkan-compatible GPU (NVIDIA, AMD, Intel)" - ForegroundColor Yellow
498+ if ($gpuBuild ) {
499+ Write-Host " • GPU Version: Requires Vulkan-compatible GPU (NVIDIA, AMD, Intel)" - ForegroundColor Yellow
500+ } else {
501+ Write-Host " • GPU Version: Not built (Vulkan SDK not available)" - ForegroundColor Red
502+ }
428503Write-Host " "
429504Write-Info " 📋 Next Steps:"
430- Write-Host " 1. Test the CPU installer on a Windows machine without GPU" - ForegroundColor Yellow
431- Write-Host " 2. Test the GPU installer on a Windows machine with NVIDIA/AMD/Intel GPU" - ForegroundColor Yellow
432- Write-Host " 3. Update release notes to explain the two versions" - ForegroundColor Yellow
433- Write-Host " 4. Add download instructions for users to choose the right version" - ForegroundColor Yellow
434- Write-Host " 5. Publish the release when ready" - ForegroundColor Yellow
505+ Write-Host " 1. Test the CPU installer on a Windows machine" - ForegroundColor Yellow
506+ if ($gpuBuild ) {
507+ Write-Host " 2. Test the GPU installer on a Windows machine with NVIDIA/AMD/Intel GPU" - ForegroundColor Yellow
508+ Write-Host " 3. Update release notes to explain the two versions" - ForegroundColor Yellow
509+ Write-Host " 4. Add download instructions for users to choose the right version" - ForegroundColor Yellow
510+ Write-Host " 5. Publish the release when ready" - ForegroundColor Yellow
511+ } else {
512+ Write-Host " 2. Update release notes (CPU-only for Windows)" - ForegroundColor Yellow
513+ Write-Host " 3. Consider building GPU version later with Vulkan SDK installed" - ForegroundColor Yellow
514+ Write-Host " 4. Publish the release when ready" - ForegroundColor Yellow
515+ }
435516
436517Write-Success " 🎉 Windows dual build release process completed successfully!"
0 commit comments