fix the missing livekit_ffi dylib and protobuf deps on windows in CM… #9
Workflow file for this run
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: Release SDK | |
| on: | |
| push: | |
| tags: | |
| - "v*" # Triggers on version tags like v0.1.0, v1.0.0 | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to release (e.g., 0.1.0)' | |
| required: true | |
| type: string | |
| env: | |
| CARGO_TERM_COLOR: always | |
| VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| name: linux-x64 | |
| generator: Ninja | |
| - os: macos-latest | |
| name: macos-arm64 | |
| generator: Ninja | |
| - os: windows-latest | |
| name: windows-x64 | |
| generator: "Visual Studio 17 2022" | |
| name: Build (${{ matrix.name }}) | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout (with submodules) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| # ---------- Extract version ---------- | |
| - name: Extract version | |
| id: version | |
| shell: bash | |
| run: | | |
| if [[ -n "${{ github.event.inputs.version }}" ]]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| VERSION="${GITHUB_REF#refs/tags/v}" | |
| else | |
| VERSION="0.0.0-dev" | |
| fi | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| echo "SDK Version: ${VERSION}" | |
| # ---------- vcpkg for Windows ---------- | |
| - name: Export GitHub Actions cache environment variables | |
| if: runner.os == 'Windows' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
| - name: Setup vcpkg (Windows only) | |
| if: runner.os == 'Windows' | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgGitCommitId: 'c82f74667287d3dc386bce81e44964370c91a289' | |
| # ---------- OS-specific deps ---------- | |
| - name: Install deps (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| set -eux | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential cmake ninja-build pkg-config \ | |
| llvm-dev libclang-dev clang \ | |
| libva-dev libdrm-dev libgbm-dev libx11-dev libgl1-mesa-dev \ | |
| libxext-dev libxcomposite-dev libxdamage-dev libxfixes-dev \ | |
| libxrandr-dev libxi-dev libxkbcommon-dev \ | |
| libasound2-dev libpulse-dev \ | |
| libssl-dev \ | |
| libprotobuf-dev protobuf-compiler \ | |
| libabsl-dev \ | |
| libwayland-dev libdecor-0-dev | |
| - name: Install deps (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| set -eux | |
| brew update | |
| brew install cmake ninja protobuf abseil | |
| # ---------- Rust toolchain ---------- | |
| - name: Install Rust (stable) | |
| uses: dtolnay/rust-toolchain@stable | |
| # ---------- Cache Cargo ---------- | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-reg-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo-reg- | |
| # ---------- Build environment setup ---------- | |
| - name: Set Linux build environment | |
| if: runner.os == 'Linux' | |
| run: | | |
| echo "CXXFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV | |
| echo "CFLAGS=-Wno-deprecated-declarations" >> $GITHUB_ENV | |
| LLVM_VERSION=$(llvm-config --version | cut -d. -f1) | |
| echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> $GITHUB_ENV | |
| # ---------- Build + Bundle (Unix) ---------- | |
| - name: Build and Bundle (Unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| chmod +x build.sh | |
| version="${{ steps.version.outputs.version }}" | |
| bundleDir="sdk-out/livekit-sdk-${{ matrix.name }}-${version}" | |
| ./build.sh release-examples --bundle --prefix "$bundleDir" | |
| # List bundle contents | |
| echo "Bundle contents:" | |
| find "$bundleDir" -type f | head -120 | |
| # ---------- Build + Bundle (Windows) ---------- | |
| - name: Build and Bundle (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| .\build.cmd release-examples | |
| $version = "${{ steps.version.outputs.version }}" | |
| $bundleDir = "sdk-out/livekit-sdk-${{ matrix.name }}-$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" | |
| Write-Host "Bundle contents:" | |
| Get-ChildItem -Recurse -File $bundleDir | Select-Object -First 200 | ForEach-Object { $_.FullName } | |
| # ---------- Upload artifact (raw directory, no pre-compression) ---------- | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }} | |
| path: sdk-out/livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }} | |
| # ---------- Release Job ---------- | |
| release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: write | |
| if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Extract version | |
| id: version | |
| shell: bash | |
| run: | | |
| if [[ -n "${{ github.event.inputs.version }}" ]]; then | |
| VERSION="${{ github.event.inputs.version }}" | |
| elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| VERSION="${GITHUB_REF#refs/tags/v}" | |
| else | |
| VERSION="0.0.0-dev" | |
| fi | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ${{ github.workspace }}/artifacts | |
| - name: List downloaded artifacts | |
| run: | | |
| echo "Downloaded artifacts structure:" | |
| find ${{ github.workspace }}/artifacts -type f | head -100 | |
| # ---------- Create archives in release job ---------- | |
| - name: Create release archives | |
| shell: bash | |
| run: | | |
| mkdir -p release-assets | |
| VERSION="${{ steps.version.outputs.version }}" | |
| cd ${{ github.workspace }}/artifacts | |
| # List what we have | |
| echo "Artifacts downloaded:" | |
| ls -la | |
| # Create tar.gz for Linux and macOS | |
| for platform in linux-x64 macos-arm64; do | |
| dirName="livekit-sdk-${platform}-${VERSION}" | |
| if [[ -d "${dirName}" ]]; then | |
| echo "Creating archive for ${platform}..." | |
| tar -czf "${{ github.workspace }}/release-assets/${dirName}.tar.gz" "${dirName}" | |
| echo "Created: ${dirName}.tar.gz" | |
| fi | |
| done | |
| # Create zip for Windows | |
| dirName="livekit-sdk-windows-x64-${VERSION}" | |
| if [[ -d "${dirName}" ]]; then | |
| echo "Creating archive for windows-x64..." | |
| zip -r "${{ github.workspace }}/release-assets/${dirName}.zip" "${dirName}" | |
| echo "Created: ${dirName}.zip" | |
| fi | |
| - name: List release assets | |
| run: ls -la ${{ github.workspace }}/release-assets/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ steps.version.outputs.version }} | |
| name: LiveKit C++ SDK v${{ steps.version.outputs.version }} | |
| draft: true | |
| files: ${{ github.workspace }}/release-assets/* | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |