fix Vulkan #72
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 | |
| on: [push, pull_request] | |
| jobs: | |
| desktop: | |
| name: Desktop ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel, ubuntu-24.04-arm] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Dependencies (Linux) | |
| if: contains(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgles2-mesa-dev glslang-tools | |
| - name: Install Dependencies (macOS) | |
| if: contains(matrix.os, 'macos') | |
| run: brew install glslang | |
| - name: Install Dependencies (Windows) | |
| if: contains(matrix.os, 'windows') | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = 'Continue' | |
| choco install vulkan-sdk -y | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "Chocolatey install failed, falling back to winget..." | |
| winget install --id KhronosGroup.VulkanSDK --accept-package-agreements --accept-source-agreements --disable-interactivity | |
| } | |
| $ErrorActionPreference = 'Stop' | |
| $sdkDir = Get-ChildItem 'C:\VulkanSDK' -Directory | Sort-Object Name -Descending | Select-Object -First 1 | |
| if (-not $sdkDir) { throw "Vulkan SDK not found under C:\VulkanSDK" } | |
| "$($sdkDir.FullName)\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| glslangValidator --version | |
| - name: Build Desktop | |
| run: python3 scripts/build.py desktop | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: live2d-desktop-${{ matrix.os }} | |
| path: out/*.jar | |
| android: | |
| name: Android Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Setup Android NDK | |
| uses: nttld/setup-ndk@v1 | |
| with: | |
| ndk-version: r26b | |
| - name: Install Vulkan Shader Compiler | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y glslang-tools | |
| - name: Build Android | |
| run: python3 scripts/build.py android | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: live2d-android | |
| path: out/*.jar |