Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 113 additions & 4 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ on:
- .github/workflows/**
workflow_dispatch:

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
# vcpkg binary caching for Windows
Expand Down Expand Up @@ -252,7 +255,7 @@ jobs:
./build.sh clean-all || true
fi

docker-build:
docker-build-x64:
name: Build (docker-linux-x64)
runs-on: ubuntu-latest

Expand All @@ -267,9 +270,115 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: docker build -t livekit-cpp-sdk:${{ github.sha }} . -f docker/Dockerfile
run: |
docker buildx build \
--platform linux/amd64 \
--load \
-t livekit-cpp-sdk-x64:${{ github.sha }} \
. \
-f docker/Dockerfile

- name: Verify installed SDK inside image
run: |
docker run --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -c \
'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake'

- name: Build SDK inside Docker
- name: Save Docker image artifact
run: |
docker save livekit-cpp-sdk-x64:${{ github.sha }} | gzip > livekit-cpp-sdk-x64.tar.gz

- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: livekit-cpp-sdk-docker-x64
path: livekit-cpp-sdk-x64.tar.gz
retention-days: 7

docker-build-linux-arm64:
name: Build (docker-linux-arm64)
runs-on: ubuntu-24.04-arm

steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker buildx build \
--platform linux/arm64 \
--load \
-t livekit-cpp-sdk:${{ github.sha }} \
. \
-f docker/Dockerfile

- name: Verify installed SDK inside image
run: |
docker run --rm livekit-cpp-sdk:${{ github.sha }} bash -c \
'cd /client-sdk-cpp && chmod +x build.sh && ./build.sh release-examples'
'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake'

- name: Save Docker image artifact
run: |
docker save livekit-cpp-sdk:${{ github.sha }} | gzip > livekit-cpp-sdk-arm64.tar.gz

- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: livekit-cpp-sdk-docker-arm64
path: livekit-cpp-sdk-arm64.tar.gz
retention-days: 7

build-collections-linux-arm64:
name: Build (cpp-example-collection-linux-arm64)
runs-on: ubuntu-24.04-arm
needs: docker-build-linux-arm64

steps:
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: livekit-cpp-sdk-docker-arm64

- name: Load Docker image
run: gzip -dc livekit-cpp-sdk-arm64.tar.gz | docker load

- name: Build cpp-example-collection against installed SDK
run: |
docker run --rm livekit-cpp-sdk:${{ github.sha }} bash -lc '
set -euxo pipefail
git clone https://github.com/livekit-examples/cpp-example-collection.git /tmp/cpp-example-collection
cd /tmp/cpp-example-collection
git checkout sderosa/examples-migration
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk
cmake --build build --parallel
'

build-collections-x64:
name: Build (cpp-example-collection-x64)
runs-on: ubuntu-latest
needs: docker-build-x64

steps:
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: livekit-cpp-sdk-docker-x64

- name: Load Docker image
run: gzip -dc livekit-cpp-sdk-x64.tar.gz | docker load

- name: Build cpp-example-collection against installed SDK
run: |
docker run --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -lc '
set -euxo pipefail
git clone https://github.com/livekit-examples/cpp-example-collection.git /tmp/cpp-example-collection
cd /tmp/cpp-example-collection
git checkout sderosa/examples-migration
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk
cmake --build build --parallel
'
18 changes: 18 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,33 @@ FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV HOME=/root
ENV SDK_INSTALL_PREFIX=/opt/livekit-sdk

# Install make, pkg-config, and base build deps (pkg-config + libglib2.0-dev for Rust glib-sys, libasound2-dev for alsa-sys)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
libasound2-dev \
libabsl-dev \
libclang-dev \
libdrm-dev \
libglib2.0-dev \
libprotobuf-dev \
libdecor-0-dev \
libspdlog-dev \
libssl-dev \
libunwind-dev \
libusb-1.0-0-dev \
libva-dev \
libwayland-dev \
make \
ninja-build \
pkg-config \
protobuf-compiler \
wget \
llvm-dev \
clang \
xz-utils \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -122,3 +130,13 @@ RUN mkdir -p /client-sdk-cpp/client-sdk-rust/.cargo \
&& printf '%s\n' '[target.x86_64-unknown-linux-gnu]' 'linker = "/root/gcc-14/bin/g++"' \
'[target.aarch64-unknown-linux-gnu]' 'linker = "/root/gcc-14/bin/g++"' > /client-sdk-cpp/client-sdk-rust/.cargo/config.toml

# Build and install the SDK into a fixed prefix so downstream projects can
# consume the image as a prebuilt LiveKit SDK environment.
RUN LLVM_VERSION="$(llvm-config --version | cut -d. -f1)" \
&& export LIBCLANG_PATH="/usr/lib/llvm-${LLVM_VERSION}/lib" \
&& export CXXFLAGS="-Wno-deprecated-declarations" \
&& export CFLAGS="-Wno-deprecated-declarations" \
&& chmod +x /client-sdk-cpp/build.sh \
&& cd /client-sdk-cpp \
&& ./build.sh release --bundle --prefix "${SDK_INSTALL_PREFIX}" \
&& test -f "${SDK_INSTALL_PREFIX}/lib/cmake/LiveKit/LiveKitConfig.cmake"
Loading