fork/rust-sdks

git clone https://git.julia.blue/fork/rust-sdks

Mathew Kamkarupdate builder runner os (#578)3507dc0

livekit/livekit-ffi@0.13.0
3.0 KiB93 linesraw
1# Copyright 2023 LiveKit, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15name: Builds
16
17on:
18  push:
19    branches: ["main"]
20    paths:
21      - livekit/**
22      - libwebrtc/**
23  pull_request:
24    branches: ["main"]
25    paths:
26      - livekit/**
27      - libwebrtc/**
28
29env:
30  CARGO_TERM_COLOR: always
31
32jobs:
33  build:
34    strategy:
35      fail-fast: false
36      matrix:
37        include:
38          - os: windows-latest
39            target: x86_64-pc-windows-msvc
40          - os: windows-latest
41            target: aarch64-pc-windows-msvc
42            #extraargs: --exclude livekit-api --exclude livekit-ffi # waiting for v0.17 of ring
43          - os: macos-latest
44            target: x86_64-apple-darwin
45          - os: macos-latest
46            target: aarch64-apple-darwin
47          - os: macos-latest
48            target: aarch64-apple-ios
49          - os: macos-latest
50            target: aarch64-apple-ios-sim
51          - os: ubuntu-latest
52            target: x86_64-unknown-linux-gnu
53          - os: ubuntu-24.04-arm
54            target: aarch64-unknown-linux-gnu
55          - os: ubuntu-latest
56            target: aarch64-linux-android
57            ndk_arch: aarch64-unknown-linux-musl
58          - os: ubuntu-latest
59            target: armv7-linux-androideabi
60            ndk_arch: arm-unknown-linux-musleabihf
61          - os: ubuntu-latest
62            target: x86_64-linux-android
63            ndk_arch: x86_64-unknown-linux-musl
64
65    name: Build (${{ matrix.target }})
66    runs-on: ${{ matrix.os }}
67    steps:
68      - uses: actions/checkout@v4
69        with:
70          submodules: true
71
72      - name: Install linux dependencies
73        if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'}}
74        run: |
75          sudo apt update -y
76          sudo apt install -y libssl-dev libx11-dev libgl1-mesa-dev libxext-dev
77
78      - uses: actions-rs/toolchain@v1
79        with:
80          toolchain: stable
81          target: ${{ matrix.target }}
82
83      - name: Build (Cargo)
84        if: ${{ !contains(matrix.target, 'android') }}
85        run: |
86          cargo build --release --workspace -p livekit --target ${{ matrix.target }}
87
88      - name: Build (Android)
89        if: ${{ contains(matrix.target, 'android') }}
90        run: |
91          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/
92          cargo install cargo-ndk
93          cargo ndk --target ${{ matrix.target }} build --release -p livekit --workspace -vv