@@ -352,38 +352,99 @@ jobs:
352352 jansson:x64-windows-release `
353353 uthash:x64-windows-release `
354354 simde:x64-windows-release
355+
356+ # Export VCPKG_ROOT for subsequent steps (build.rs reads it for toolchain)
357+ " VCPKG_ROOT=$vcpkgRoot" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
358+ Write-Host "Exported VCPKG_ROOT=$vcpkgRoot"
355359
356360 - name : Build (revo-lib) + build.rs builds OBS
357361 shell : pwsh
358362 run : |
359363 $ErrorActionPreference = "Stop"
360-
361- # Point build.rs/CMake to vcpkg toolchain
362- $env:VCPKG_ROOT = $env:VCPKG_INSTALLATION_ROOT
363- $env:VCPKG_TOOLCHAIN_FILE = Join-Path $env:VCPKG_ROOT "scripts\buildsystems\vcpkg.cmake"
364+
365+ # VCPKG_ROOT is written to GITHUB_ENV by the install step above;
366+ # it is already available as a process env var here.
367+ Write-Host "VCPKG_ROOT=$env:VCPKG_ROOT"
368+ Write-Host "CMAKE_SYSTEM_VERSION=$env:CMAKE_SYSTEM_VERSION"
369+
370+ if (-not $env:VCPKG_ROOT -or -not (Test-Path $env:VCPKG_ROOT)) {
371+ throw "VCPKG_ROOT ('$env:VCPKG_ROOT') is not set or does not exist."
372+ }
373+
364374 $env:VCPKG_DEFAULT_TRIPLET = "x64-windows-release"
365-
366- # IMPORTANT: do NOT force manifests here (it can break classic mode)
367- # $env:VCPKG_FEATURE_FLAGS = "manifests"
368-
375+
369376 cargo build --release
370377
371- - name : Package artifact (basic )
378+ - name : Package artifact (prebuilt layout )
372379 shell : pwsh
373380 run : |
374381 $ErrorActionPreference = "Stop"
375-
382+
376383 $arch = "x86_64"
377384 $staging = "libobs-prebuilt-windows-$arch"
378- New-Item -ItemType Directory -Force -Path $staging | Out-Null
379-
380- New-Item -ItemType Directory -Force -Path "$staging\target-release" | Out-Null
381- Copy-Item -Recurse -Force "target\release\*" "$staging\target-release\"
382-
383- " REVO_OBS_REF=$env:REVO_OBS_REF" | Out-File -Append -Encoding ascii "$staging\build-info.env"
384- " BUILD_DATE=$(Get-Date -AsUTC -Format o)" | Out-File -Append -Encoding ascii "$staging\build-info.env"
385- " ARCH=$arch" | Out-File -Append -Encoding ascii "$staging\build-info.env"
386-
385+
386+ $obsSrc = "obs-libobs\obs-studio"
387+ $buildDir = "$obsSrc\build-headless"
388+ $installDir = "$buildDir\install"
389+
390+ New-Item -ItemType Directory -Force -Path "$staging\lib" | Out-Null
391+ New-Item -ItemType Directory -Force -Path "$staging\bin" | Out-Null
392+ New-Item -ItemType Directory -Force -Path "$staging\include\obs" | Out-Null
393+ New-Item -ItemType Directory -Force -Path "$staging\bindings" | Out-Null
394+
395+ # 1) Import lib (obs.lib) – searched by rustc
396+ $obsLib = Get-ChildItem -Recurse "$buildDir" -Filter "obs.lib" -ErrorAction SilentlyContinue | Select-Object -First 1
397+ if ($obsLib) {
398+ Copy-Item $obsLib.FullName "$staging\lib\obs.lib"
399+ Write-Host "Copied obs.lib from $($obsLib.FullName)"
400+ } else {
401+ Write-Warning "obs.lib not found under $buildDir"
402+ }
403+
404+ # 2) DLL (obs.dll) – needed at runtime
405+ $obsDll = Get-ChildItem -Recurse "$buildDir" -Filter "obs.dll" -ErrorAction SilentlyContinue | Select-Object -First 1
406+ if ($obsDll) {
407+ Copy-Item $obsDll.FullName "$staging\bin\obs.dll"
408+ Write-Host "Copied obs.dll from $($obsDll.FullName)"
409+ } else {
410+ Write-Warning "obs.dll not found under $buildDir"
411+ }
412+
413+ # 3) Headers
414+ if (Test-Path "$installDir\include\obs") {
415+ Copy-Item -Recurse "$installDir\include\obs\*" "$staging\include\obs\"
416+ Write-Host "Copied installed headers from $installDir\include\obs"
417+ }
418+ Get-ChildItem "$obsSrc\libobs" -Filter "*.h" | ForEach-Object {
419+ Copy-Item $_.FullName "$staging\include\obs\" -Force
420+ }
421+ # obsconfig.h
422+ $obscfg = Get-ChildItem -Recurse "$buildDir" -Filter "obsconfig.h" -ErrorAction SilentlyContinue | Select-Object -First 1
423+ if ($obscfg) {
424+ Copy-Item $obscfg.FullName "$staging\include\obs\obsconfig.h" -Force
425+ Write-Host "Copied obsconfig.h from $($obscfg.FullName)"
426+ } else {
427+ Write-Warning "obsconfig.h not found"
428+ }
429+
430+ # 4) Bindings
431+ $bindings = Get-ChildItem -Recurse "target" -Filter "libobs_bindings.rs" -ErrorAction SilentlyContinue | Select-Object -First 1
432+ if ($bindings) {
433+ Copy-Item $bindings.FullName "$staging\bindings\libobs_bindings.rs"
434+ Write-Host "Copied bindings from $($bindings.FullName)"
435+ } else {
436+ Write-Error "libobs_bindings.rs not found in target\**\out\"
437+ exit 1
438+ }
439+
440+ # 5) Metadata
441+ "REVO_OBS_REF=$env:REVO_OBS_REF" | Out-File -Append -Encoding ascii "$staging\build-info.env"
442+ "BUILD_DATE=$(Get-Date -AsUTC -Format o)" | Out-File -Append -Encoding ascii "$staging\build-info.env"
443+ "ARCH=$arch" | Out-File -Append -Encoding ascii "$staging\build-info.env"
444+
445+ Write-Host "Artifact layout:"
446+ Get-ChildItem -Recurse $staging | Where-Object { -not $_.Name.EndsWith(".h") } | Sort-Object FullName | ForEach-Object { Write-Host $_.FullName }
447+
387448 "STAGING=$staging" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
388449
389450 - name : Upload Windows artifact
0 commit comments