@@ -29,13 +29,51 @@ jobs:
2929 if : contains(matrix.os, 'ubuntu')
3030 run : |
3131 sudo apt-get update
32- sudo apt-get install -y libgles2-mesa-dev glslang-tools
32+ sudo apt-get install -y libgles2-mesa-dev libvulkan-dev glslang-tools
3333
3434 - name : Install Dependencies (macOS)
3535 if : contains(matrix.os, 'macos')
3636 run : brew install glslang
3737
38- - name : Install Dependencies (Windows)
38+ - name : Install Vulkan SDK (Windows)
39+ if : contains(matrix.os, 'windows')
40+ shell : pwsh
41+ run : |
42+ $ErrorActionPreference = 'Stop'
43+
44+ function Find-VulkanSdkDir {
45+ $patterns = @(
46+ 'C:\VulkanSDK\*',
47+ 'C:\Program Files\VulkanSDK\*',
48+ "$env:USERPROFILE\VulkanSDK\*"
49+ )
50+ foreach ($pattern in $patterns) {
51+ $dir = Get-ChildItem -Path $pattern -Directory -ErrorAction SilentlyContinue |
52+ Sort-Object Name -Descending | Select-Object -First 1
53+ if ($dir) { return $dir.FullName }
54+ }
55+ return $null
56+ }
57+
58+ $installed = $false
59+ try {
60+ winget install --id KhronosGroup.VulkanSDK --accept-package-agreements --accept-source-agreements --disable-interactivity
61+ if ($LASTEXITCODE -eq 0) { $installed = $true }
62+ } catch {
63+ Write-Host "winget install failed: $($_.Exception.Message)"
64+ }
65+ if (-not $installed) {
66+ choco install vulkan-sdk -y
67+ }
68+
69+ $sdkDir = Find-VulkanSdkDir
70+ if (-not $sdkDir) { throw "Vulkan SDK not found after installation." }
71+
72+ Write-Host "Using Vulkan SDK: $sdkDir"
73+ "VULKAN_SDK=$sdkDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
74+ (Join-Path $sdkDir 'Bin') | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
75+
76+ - name : Install glslang (Windows)
3977 if : contains(matrix.os, 'windows')
4078 shell : pwsh
4179 run : |
@@ -84,7 +122,14 @@ jobs:
84122 $toolDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
85123 & $tool.FullName --version
86124
125+ - name : Build Desktop (Require Vulkan on windows-x64/linux-x64)
126+ if : matrix.os == 'windows-latest' || matrix.os == 'ubuntu-latest'
127+ env :
128+ LIVE2D_REQUIRE_VULKAN : " ON"
129+ run : python3 scripts/build.py desktop
130+
87131 - name : Build Desktop
132+ if : matrix.os != 'windows-latest' && matrix.os != 'ubuntu-latest'
88133 run : python3 scripts/build.py desktop
89134
90135 - name : Upload Artifacts
0 commit comments