Skip to content

Commit

Permalink
Merge branch 'main' into duan/aec3-experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Dec 31, 2024
2 parents 4326d14 + cc889da commit efff9f6
Show file tree
Hide file tree
Showing 115 changed files with 7,826 additions and 1,132 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ jobs:
target: aarch64-unknown-linux-gnu
- os: ubuntu-20.04
target: aarch64-linux-android
ndk_arch: aarch64-unknown-linux-musl
- os: ubuntu-20.04
target: armv7-linux-androideabi
ndk_arch: arm-unknown-linux-musleabihf
- os: ubuntu-20.04
target: x86_64-linux-android
ndk_arch: x86_64-unknown-linux-musl

name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -85,5 +88,6 @@ jobs:
- name: Build (Android)
if: ${{ contains(matrix.target, 'android') }}
run: |
ln -sf $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/${{ matrix.ndk_arch }}/{libunwind.so,libc++abi.a} $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/
cargo install cargo-ndk
cargo ndk --target ${{ matrix.target }} build --release -p livekit --workspace -vv
61 changes: 32 additions & 29 deletions .github/workflows/ffi-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
push:
branches: ["main"]
tags:
- "ffi-v*"
- "rust-sdks/livekit-ffi@*"
workflow_dispatch:

env:
Expand Down Expand Up @@ -78,28 +78,30 @@ jobs:
dylib: liblivekit_ffi.so
target: aarch64-unknown-linux-gnu
name: ffi-linux-arm64
## android builds broke
# - os: ubuntu-20.04
# platform: android
# dylib: liblivekit_ffi.so
# jar: libwebrtc.jar
# target: aarch64-linux-android
# name: ffi-android-arm64
# buildargs: --no-default-features --features "rustls-tls-webpki-roots"
# - os: ubuntu-20.04
# platform: android
# dylib: liblivekit_ffi.so
# jar: libwebrtc.jar
# target: armv7-linux-androideabi
# name: ffi-android-armv7
# buildargs: --no-default-features --features "rustls-tls-webpki-roots"
# - os: ubuntu-20.04
# platform: android
# dylib: liblivekit_ffi.so
# jar: libwebrtc.jar
# target: x86_64-linux-android
# name: ffi-android-x86_64
# buildargs: --no-default-features --features "rustls-tls-webpki-roots"
- os: ubuntu-20.04
platform: android
dylib: liblivekit_ffi.so
jar: libwebrtc.jar
target: aarch64-linux-android
ndk_arch: aarch64-unknown-linux-musl
name: ffi-android-arm64
buildargs: --no-default-features --features "rustls-tls-webpki-roots"
- os: ubuntu-20.04
platform: android
dylib: liblivekit_ffi.so
jar: libwebrtc.jar
target: armv7-linux-androideabi
ndk_arch: arm-unknown-linux-musleabihf
name: ffi-android-armv7
buildargs: --no-default-features --features "rustls-tls-webpki-roots"
- os: ubuntu-20.04
platform: android
dylib: liblivekit_ffi.so
jar: libwebrtc.jar
target: x86_64-linux-android
ndk_arch: x86_64-unknown-linux-musl
name: ffi-android-x86_64
buildargs: --no-default-features --features "rustls-tls-webpki-roots"

name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -157,6 +159,7 @@ jobs:
if: ${{ matrix.platform == 'android' }}
run: |
cd livekit-ffi/
ln -sf $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/${{ matrix.ndk_arch }}/{libunwind.so,libc++abi.a} $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib/
cargo install cargo-ndk
cargo ndk --bindgen --target ${{ matrix.target }} build --release ${{ matrix.buildargs }}
Expand Down Expand Up @@ -193,28 +196,28 @@ jobs:
Get-ChildItem -Path ${{ matrix.dylib }}, livekit_ffi.h, LICENSE.md | Compress-Archive -DestinationPath ${{ github.workspace }}\${{ matrix.name }}.zip
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ffi-builds
name: ffi-builds-${{ matrix.target }}
path: ${{ matrix.name }}.zip


release:
name: Release to GH (Draft)
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/ffi-v')
if: startsWith(github.ref, 'refs/tags/rust-sdks/livekit-ffi')
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ffi-builds
pattern: ffi-builds-*
merge-multiple: true
path: ${{ github.workspace }}/ffi-builds

- name: Create draft release
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ jobs:
toolchain: nightly-2023-12-30
components: rustfmt

- name: Check workspace versions match
run: |
cargo metadata --format-version=1 --no-deps |
jq -e -r '.packages[] | "\(.name) \(.version)"' |
sort | xargs -l bash -c \
'grep "$0 = { version = \"$1\"" -q Cargo.toml && printf "version %-7s %-27s $0\n" $1 "matches package" || printf "version %-7s is not reflected on package $0\n" "$1" | false';
if [ $? -eq 0 ]; then exit 0; else exit 1; fi
- name: Cargo fmt
run: |
cargo fmt -- --check
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.NANPA_KEY }}
- uses: nbsp/ilo@v1
with:
packages: ${{ github.event.inputs.packages }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
steps:
- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup target add ${{ matrix.target }}
rustup update --no-self-update nightly
rustup target add ${{ matrix.target }} --toolchain nightly
- name: Install linux dependencies
if: ${{ matrix.os == 'ubuntu-20.04' }}
Expand All @@ -57,6 +57,6 @@ jobs:
submodules: true

- name: Test
run: cargo test --release --verbose --target ${{ matrix.target }} -- --nocapture
run: cargo +nightly test --release --verbose --target ${{ matrix.target }} -- --nocapture


26 changes: 13 additions & 13 deletions .github/workflows/webrtc-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ jobs:
cmd: ./build_macos.sh
arch: arm64

- name: linux
- name: linux
os: buildjet-8vcpu-ubuntu-2004
cmd: ./build_linux.sh
arch: x64

- name: linux
os: buildjet-8vcpu-ubuntu-2004
cmd: ./build_linux.sh
arch: arm64
arch: arm64

- name: android
os: buildjet-8vcpu-ubuntu-2004
cmd: ./build_android.sh
Expand All @@ -81,10 +81,10 @@ jobs:
os: macos-13
cmd: ./build_ios.sh
arch: arm64
buildargs: --environment simulator
buildargs: --environment simulator
profile:
- release
# - debug
# - debug

name: Build webrtc (${{ matrix.target.name }}-${{ matrix.target.arch }}-${{ matrix.profile }}) ${{ matrix.target.buildargs }}
runs-on: ${{ matrix.target.os }}
Expand All @@ -104,7 +104,7 @@ jobs:
echo "OutName: ${{ steps.setup.outputs.OUT }}"
echo "OutZip: ${{ steps.setup.outputs.ZIP }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
run: echo -e "\ntarget_os = [\"${{ matrix.target.name }}\"]" >> .gclient
shell: bash
working-directory: webrtc-sys/libwebrtc

- name: Build WebRTC
run: ${{ matrix.target.cmd }} --arch ${{ matrix.target.arch }} --profile ${{ matrix.profile }} ${{ matrix.target.buildargs }}
working-directory: webrtc-sys/libwebrtc
Expand All @@ -151,12 +151,11 @@ jobs:
run: Compress-Archive -Path .\webrtc-sys\libwebrtc\${{ steps.setup.outputs.OUT }} -DestinationPath ${{ steps.setup.outputs.ZIP }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: webrtc-builds
name: webrtc-builds-${{ steps.setup.outputs.OUT }}
path: ${{ steps.setup.outputs.ZIP }}


release:
name: Release to GH (Draft)
runs-on: ubuntu-latest
Expand All @@ -167,12 +166,13 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: webrtc-builds
pattern: webrtc-builds-*
merge-multiple: true
path: ${{ github.workspace }}/webrtc-builds

- name: Create draft release
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "livekit/protocol"]
path = livekit-protocol/protocol
url = https://github.com/livekit/protocol
[submodule "yuv-sys/libyuv"]
path = yuv-sys/libyuv
url = https://chromium.googlesource.com/libyuv/libyuv
2 changes: 1 addition & 1 deletion .nanparc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
packages livekit livekit-ffi livekit-protocol livekit-runtime livekit-api libwebrtc webrtc-sys webrtc-sys/build soxr-sys
packages livekit livekit-ffi livekit-protocol livekit-runtime livekit-api libwebrtc webrtc-sys webrtc-sys/build soxr-sys yuv-sys imgproc
17 changes: 7 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
[workspace]
resolver = "2"
members = [
"livekit",
"livekit-api",
"livekit-protocol",
"livekit-ffi",
"livekit-runtime",
"libwebrtc",
"soxr-sys",
"yuv-sys",
"imgproc",
"webrtc-sys",
"webrtc-sys/build",
]

[workspace.dependencies]
imgproc = { version = "0.3.12", path = "imgproc" }
yuv-sys = { version = "0.3.7", path = "yuv-sys" }
libwebrtc = { version = "0.3.8", path = "libwebrtc" }
livekit-api = { version = "0.4.1", path = "livekit-api" }
livekit-ffi = { version = "0.12.4", path = "livekit-ffi" }
livekit-protocol = { version = "0.3.6", path = "livekit-protocol" }
livekit-runtime = { version = "0.3.1", path = "livekit-runtime" }
livekit = { version = "0.7.1", path = "livekit" }
soxr-sys = { version = "0.1.0", path = "soxr-sys" }
webrtc-sys-build = { version = "0.3.6", path = "webrtc-sys/build" }
webrtc-sys = { version = "0.3.6", path = "webrtc-sys" }
2 changes: 1 addition & 1 deletion download_ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def ffi_version():

def download_ffi(platform, arch, version, output):
filename = "ffi-%s-%s.zip" % (platform, arch)
url = "https://github.com/livekit/client-sdk-rust/releases/download/ffi-v%s/%s"
url = "https://github.com/livekit/client-sdk-rust/releases/download/rust-sdks/livekit-ffi@%s/%s"
url = url % (version, filename)

tmp = os.path.join(tempfile.gettempdir(), filename)
Expand Down
Loading

0 comments on commit efff9f6

Please sign in to comment.