-
-
Notifications
You must be signed in to change notification settings - Fork 199
124 lines (97 loc) · 4.46 KB
/
Copy pathbuild.yml
File metadata and controls
124 lines (97 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Build BetterVR
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-2025-vs2026
defaults:
run:
shell: pwsh
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up MSVC dev environment
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- name: Install Vulkan SDK (direct from LunarG)
run: |
$ErrorActionPreference = "Stop"
$latest = Invoke-RestMethod "https://vulkan.lunarg.com/sdk/latest/windows.json"
$ver = $latest.windows
if (-not $ver) { throw "Failed to determine latest Vulkan SDK version." }
Write-Host "Latest Vulkan SDK version: $ver"
$exe = "vulkansdk-windows-X64-$ver.exe"
$urlNew = "https://sdk.lunarg.com/sdk/download/$ver/windows/$exe"
$urlOld = "https://sdk.lunarg.com/sdk/download/$ver/windows/VulkanSDK-$ver-Installer.exe"
try {
Write-Host "Downloading: $urlNew"
Invoke-WebRequest $urlNew -OutFile $exe
} catch {
Write-Host "New-name download failed; trying legacy filename..."
Write-Host "Downloading: $urlOld"
Invoke-WebRequest $urlOld -OutFile $exe
}
$installRoot = "C:\VulkanSDK\$ver"
New-Item -ItemType Directory -Force -Path $installRoot | Out-Null
& ".\$exe" --root $installRoot --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.debug copy_only=1
"VULKAN_SDK=$installRoot" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"VK_SDK_PATH=$installRoot" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"$installRoot\Bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
Write-Host "Installed Vulkan SDK to $installRoot"
- name: Clone vcpkg
run: |
git clone https://github.com/microsoft/vcpkg "$env:GITHUB_WORKSPACE\vcpkg"
- name: Bootstrap vcpkg
run: |
& "$env:GITHUB_WORKSPACE\vcpkg\bootstrap-vcpkg.bat" -disableMetrics
- name: Export vcpkg environment for scripts
run: |
"VCPKG_ROOT=$env:GITHUB_WORKSPACE\vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"VCPKG_DEFAULT_TRIPLET=x64-windows-static-md" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Install vcpkg dependencies (manifest mode)
run: |
$ErrorActionPreference = "Stop"
$vcpkg = "$env:GITHUB_WORKSPACE\vcpkg\vcpkg.exe"
if (!(Test-Path "$env:GITHUB_WORKSPACE\vcpkg.json")) {
throw "vcpkg.json not found at repo root (expected manifest mode)."
}
& $vcpkg install `
--x-manifest-root "$env:GITHUB_WORKSPACE" `
--triplet "x64-windows-static-md"
- name: Patch CMakeUserPresets.json (set VCPKG_ROOT for all presets)
run: |
$presetPath = Join-Path $env:GITHUB_WORKSPACE "CMakeUserPresets.json"
if (!(Test-Path $presetPath)) { throw "CMakeUserPresets.json not found at repo root." }
$vcpkgRoot = Join-Path $env:GITHUB_WORKSPACE "vcpkg"
$json = Get-Content $presetPath -Raw | ConvertFrom-Json
if ($null -eq $json.configurePresets) { throw "configurePresets missing in CMakeUserPresets.json" }
foreach ($p in $json.configurePresets) {
if ($null -eq $p.environment) { $p | Add-Member -NotePropertyName environment -NotePropertyValue (@{}) }
$p.environment.VCPKG_ROOT = $vcpkgRoot
}
$json | ConvertTo-Json -Depth 50 | Set-Content $presetPath -Encoding UTF8
Write-Host "Patched VCPKG_ROOT to: $vcpkgRoot"
- name: Build and install launcher (RelWithDebInfo)
run: |
if (!(Test-Path "$env:GITHUB_WORKSPACE\build_mod.bat")) {
throw "build_mod.bat not found at repo root."
}
cmd /c build_mod.bat RelWithDebInfo
- name: Verify launcher outputs
run: |
if (!(Test-Path "$env:GITHUB_WORKSPACE\Cemu\BetterVR_Launcher.exe")) {
throw "BetterVR_Launcher.exe not found in Cemu output directory."
}
- name: Upload launcher exe
uses: actions/upload-artifact@v4
with:
name: BetterVR_Launcher
path: Cemu/BetterVR_Launcher.exe
if-no-files-found: error