From 0251073dc141200315a281734ffdbbe80db617fb Mon Sep 17 00:00:00 2001 From: Alan George Date: Thu, 20 Aug 2026 15:34:03 -0600 Subject: [PATCH 1/5] Use the same bundle for CI runs as releases --- .github/workflows/builds.yml | 28 ++++++++++------ .github/workflows/make-release.yml | 6 +--- AGENTS.md | 5 +++ build.cmd | 54 +++++++++++++++++++++++++++++- 4 files changed, 77 insertions(+), 16 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index c4d99a10..29cc64ab 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -34,24 +34,24 @@ jobs: include: - os: ubuntu-latest name: linux-x64 - build_cmd: ./build.sh release-examples + build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-linux-x64 build_dir: build-release - os: ubuntu-24.04-arm name: linux-arm64 - build_cmd: ./build.sh release-examples + build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-linux-arm64 build_dir: build-release - os: macos-26-xlarge name: macos-arm64 - build_cmd: ./build.sh release-examples + build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-macos-arm64 build_dir: build-release - os: macos-26-large name: macos-x64 - build_cmd: ./build.sh release-examples --macos-arch x86_64 + build_cmd: ./build.sh release-examples --bundle --prefix sdk-out/livekit-sdk-macos-x64 --macos-arch x86_64 build_dir: build-release # Pinned to Windows 2022 for current VS 17 implementation - os: windows-2022 name: windows-x64 - build_cmd: .\build.cmd release-examples + build_cmd: .\build.cmd release-examples --bundle --prefix sdk-out\livekit-sdk-windows-x64 build_dir: build-release name: Build (${{ matrix.name }}) @@ -317,15 +317,23 @@ jobs: } if ($failed) { exit 1 } else { exit 0 } + - name: Verify SDK bundle + shell: bash + run: | + set -euo pipefail + bundle="sdk-out/livekit-sdk-${{ matrix.name }}" + test -f "${bundle}/include/livekit/livekit.h" + test -f "${bundle}/share/livekit/build-info.json" + test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfig.cmake" + test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfigVersion.cmake" + test -f "${bundle}/lib/cmake/LiveKit/LiveKitTargets.cmake" + # ---------- Upload artifacts ---------- - - name: Upload build artifacts + - name: Upload SDK bundle uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: livekit-sdk-${{ matrix.name }} - path: | - ${{ matrix.build_dir }}/lib/ - ${{ matrix.build_dir }}/include/ - ${{ matrix.build_dir }}/bin/ + path: sdk-out/livekit-sdk-${{ matrix.name }} retention-days: 7 # ---------- Cleanup ---------- diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 32541653..a94db195 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -240,11 +240,7 @@ jobs: $bundleDir = "sdk-out/livekit-sdk-${{ matrix.name }}-$version" if ([string]::IsNullOrWhiteSpace($version)) { throw "version is empty" } - .\build.cmd release-examples --version "$version" - - # There is the missing step that generates LiveKitTargets.cmake in the install tree - # TODO(sxian): fix it after getting access to a windows machine - cmake --install "build-release" --config Release --prefix "$bundleDir" + .\build.cmd release-examples --version "$version" --bundle --prefix "$bundleDir" Write-Host "Bundle contents:" Get-ChildItem -Recurse -File $bundleDir | Select-Object -First 200 | ForEach-Object { $_.FullName } diff --git a/AGENTS.md b/AGENTS.md index b45973ae..32869337 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -122,6 +122,11 @@ Updates to ./build.sh and ./build.cmd should be accompanied by updates to this f ./build.sh clean-all # Full clean (C++ + local-install + Rust targets) ``` +To create an installable SDK bundle, use the same build command with +`--bundle --prefix ` (for example, +`./build.sh release --bundle --prefix sdk-out/livekit-sdk`). On Windows, use +`build.cmd release --bundle --prefix C:\path\to\livekit-sdk`. + The build scripts pass an explicit job count to `cmake --build --parallel`. Set `CMAKE_BUILD_PARALLEL_LEVEL` to override the default detected logical CPU count. diff --git a/build.cmd b/build.cmd index 76c1ac57..82e7015b 100644 --- a/build.cmd +++ b/build.cmd @@ -9,6 +9,8 @@ set "PRESET=windows-release" set "LIVEKIT_VERSION=" set "CMAKE_EXTRA_ARGS=" set "BUILD_PARALLEL_JOBS=" +set "DO_BUNDLE=" +set "PREFIX=" REM ============================================================ REM Auto-detect LIBCLANG_PATH if not already set @@ -87,7 +89,26 @@ if /I "%~1"=="--version" ( goto :get_version_value ) -:: 3. Handle unknown arguments +:: 3. Install the SDK bundle after a successful build. +if /I "%~1"=="--bundle" ( + set "DO_BUNDLE=1" + shift + goto parse_all +) + +:: 4. Set the install prefix for --bundle. +if /I "%~1"=="--prefix" ( + shift + if "%~1"=="" ( + echo ERROR: --prefix requires a value + exit /b 1 + ) + set "PREFIX=%~1" + shift + goto parse_all +) + +:: 5. Handle unknown arguments echo ERROR: Unknown option: %~1 exit /b 1 @@ -190,10 +211,15 @@ echo clean Clean both Debug and Release build directories + local- echo clean-all Full clean (build dirs + local-install + Rust targets) echo help Show this help echo. +echo Options (for debug / release): +echo --bundle Install the SDK bundle using cmake --install +echo --prefix ^ Install prefix for --bundle ^(default: .\sdk-out\livekit-sdk^) +echo. echo Examples: echo build.cmd debug echo build.cmd release echo build.cmd release-examples +echo build.cmd release --bundle --prefix C:\path\to\livekit-sdk echo build.cmd debug-tests echo build.cmd release-tests echo build.cmd release-all @@ -232,8 +258,34 @@ if errorlevel 1 ( exit /b 1 ) echo ==^> Build complete! +if defined DO_BUNDLE ( + call :install_bundle + if errorlevel 1 exit /b 1 +) goto :eof +:install_bundle +if not defined PREFIX set "PREFIX=%PROJECT_ROOT%\sdk-out\livekit-sdk" + +if not "%PREFIX:~1,1%"==":" set "PREFIX=%PROJECT_ROOT%\%PREFIX%" + +echo ==^> Installing SDK bundle to: %PREFIX% +if exist "%PREFIX%" rmdir /s /q "%PREFIX%" +if exist "%PREFIX%" ( + echo Failed to remove existing bundle directory: %PREFIX% + exit /b 1 +) +mkdir "%PREFIX%" +if errorlevel 1 exit /b 1 + +cmake --install "%BUILD_DIR%" --config %BUILD_TYPE% --prefix "%PREFIX%" +if errorlevel 1 ( + echo SDK bundle install failed! + exit /b 1 +) +echo ==^> SDK bundle installed. +exit /b 0 + :clean echo ==^> Cleaning build directories... set "BUILD_DIR_DEBUG=%PROJECT_ROOT%\build-debug" From 30f12761955c779cd5f8905270fd0eccb1c855da Mon Sep 17 00:00:00 2001 From: Alan George Date: Thu, 20 Aug 2026 16:17:54 -0600 Subject: [PATCH 2/5] Maybe fix --- build.cmd | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build.cmd b/build.cmd index 82e7015b..1e4b705f 100644 --- a/build.cmd +++ b/build.cmd @@ -99,13 +99,7 @@ if /I "%~1"=="--bundle" ( :: 4. Set the install prefix for --bundle. if /I "%~1"=="--prefix" ( shift - if "%~1"=="" ( - echo ERROR: --prefix requires a value - exit /b 1 - ) - set "PREFIX=%~1" - shift - goto parse_all + goto :get_prefix_value ) :: 5. Handle unknown arguments @@ -118,6 +112,15 @@ set "LIVEKIT_VERSION=%~1" shift goto parse_all +:get_prefix_value +if "%~1"=="" ( + echo ERROR: --prefix requires a value + exit /b 1 +) +set "PREFIX=%~1" +shift +goto parse_all + :after_parse if not defined CMD ( echo ERROR: No command specified From c3f62277f5a0ddcaaf1dd20c0e30e3c95a7cd1ee Mon Sep 17 00:00:00 2001 From: Alan George Date: Fri, 21 Aug 2026 08:30:47 -0600 Subject: [PATCH 3/5] More doc updates --- AGENTS.md | 2 +- docs/building.md | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 32869337..77d3585f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -108,7 +108,7 @@ Be sure to update the directory layout in this file if the directory layout chan ## Build for building, use the build.sh script for Linux and macOS, and the build.cmd script for Windows. Do not invoke CMake directly to build the SDK. -Updates to ./build.sh and ./build.cmd should be accompanied by updates to this file and the README.md file. +Updates to ./build.sh and ./build.cmd should be accompanied by updates to this file and docs/building.md. ``` ./build.sh debug # Debug build diff --git a/docs/building.md b/docs/building.md index 79f4e6e5..ced0eaee 100644 --- a/docs/building.md +++ b/docs/building.md @@ -115,6 +115,19 @@ wrap the right CMake preset for your platform and pick sensible defaults. # ... same suffixes as build.sh ``` +### Create an SDK bundle + +To create an installable SDK bundle with public headers, runtime libraries, and +CMake package files, add `--bundle --prefix ` to a build command: + +```bash +./build.sh release --bundle --prefix sdk-out/livekit-sdk +``` + +```powershell +.\build.cmd release --bundle --prefix C:\path\to\livekit-sdk +``` + The build scripts pass an explicit job count to `cmake --build --parallel`. Set `CMAKE_BUILD_PARALLEL_LEVEL` to override the auto-detected logical CPU count. From bf8fef11245817a0061c52ce591cba293244e32b Mon Sep 17 00:00:00 2001 From: Alan George Date: Mon, 24 Aug 2026 14:31:00 -0600 Subject: [PATCH 4/5] PR feedback --- docs/building.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/building.md b/docs/building.md index 56d682ee..8112d019 100644 --- a/docs/building.md +++ b/docs/building.md @@ -120,10 +120,14 @@ wrap the right CMake preset for your platform and pick sensible defaults. To create an installable SDK bundle with public headers, runtime libraries, and CMake package files, add `--bundle --prefix ` to a build command: +**Linux/Mac:** + ```bash ./build.sh release --bundle --prefix sdk-out/livekit-sdk ``` +**Windows:** + ```powershell .\build.cmd release --bundle --prefix C:\path\to\livekit-sdk ``` From f74c7e58715072aad908932ea2fe592247ca13d8 Mon Sep 17 00:00:00 2001 From: alan-george-lk Date: Tue, 25 Aug 2026 09:57:35 -0600 Subject: [PATCH 5/5] Update build.cmd Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- build.cmd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.cmd b/build.cmd index 1e4b705f..4869ebe7 100644 --- a/build.cmd +++ b/build.cmd @@ -272,6 +272,9 @@ if not defined PREFIX set "PREFIX=%PROJECT_ROOT%\sdk-out\livekit-sdk" if not "%PREFIX:~1,1%"==":" set "PREFIX=%PROJECT_ROOT%\%PREFIX%" +REM cmd's mkdir/rmdir reject forward slashes; normalize to backslashes. +set "PREFIX=%PREFIX:/=\%" + echo ==^> Installing SDK bundle to: %PREFIX% if exist "%PREFIX%" rmdir /s /q "%PREFIX%" if exist "%PREFIX%" (