fork/rust-sdks
git clone https://git.julia.blue/fork/rust-sdks
835d610
main
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 : WebRTC builds 16on : 17push : 18tags : 19- "webrtc-*" 20workflow_dispatch : 21 22jobs : 23build : 24strategy : 25fail-fast : false 26matrix : 27target : 28- name : win 29os : windows-latest 30cmd : .\build_windows.cmd 31arch : x64 32 33- name : win 34os : windows-latest 35cmd : .\build_windows.cmd 36arch : arm64 37 38- name : mac 39os : macos-latest 40cmd : ./build_macos.sh 41arch : x64 42 43- name : mac 44os : macos-latest 45cmd : ./build_macos.sh 46arch : arm64 47 48- name : linux 49os : ubuntu-latest 50cmd : ./build_linux.sh 51arch : x64 52 53- name : linux 54os : ubuntu-24.04-arm 55cmd : ./build_linux.sh 56arch : arm64 57 58- name : android 59os : ubuntu-latest 60cmd : ./build_android.sh 61arch : arm64 62 63- name : android 64os : ubuntu-latest 65cmd : ./build_android.sh 66arch : arm 67 68- name : android 69os : ubuntu-latest 70cmd : ./build_android.sh 71arch : x64 72 73- name : ios 74out : ios-device-arm64 75os : macos-latest 76cmd : ./build_ios.sh 77arch : arm64 78 79- name : ios 80out : ios-simulator-arm64 81os : macos-latest 82cmd : ./build_ios.sh 83arch : arm64 84buildargs : --environment simulator 85profile : 86- release 87# - debug 88 89name : Build webrtc (${{ matrix.target.name }}-${{ matrix.target.arch }}-${{ matrix.profile }}) ${{ matrix.target.buildargs }} 90runs-on : ${{ matrix.target.os }} 91steps : 92- name : Setup variables 93id : setup 94run : | 95DEFAULT_OUT=${{ matrix.target.name }}-${{ matrix.target.arch }} 96OUT=${{ matrix.target.out == '' && '$DEFAULT_OUT' || matrix.target.out }}-${{ matrix.profile }} 97echo OUT=$OUT >> $GITHUB_OUTPUT 98echo ZIP=webrtc-$OUT.zip >> $GITHUB_OUTPUT 99shell : bash 100 101# Print some debug infos to be sure everything is ok before doing really long tasks.. 102- name : Info 103run : | 104echo "OutName: ${{ steps.setup.outputs.OUT }}" 105echo "OutZip: ${{ steps.setup.outputs.ZIP }}" 106 107- uses : actions/checkout@v4 108with : 109submodules : true 110 111- uses : actions/setup-python@v4 112- run : pip3 install setuptools # pkg_resources is sometimes not found? 113 114- name : Install linux dependencies 115if : ${{ matrix.target.os == 'ubuntu-latest' }} 116run : | 117sudo apt update -y 118sudo apt install -y ninja-build pkg-config openjdk-11-jdk 119 120- name : Install macos dependencies 121if : ${{ matrix.target.os == 'macos-latest' }} 122run : brew install ninja 123 124- name : Install windows dependencies 125if : ${{ matrix.target.os == 'windows-latest' }} 126run : | 127Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/latest/download/ninja-win.zip" -OutFile ninja.zip 128Expand-Archive -Path ninja.zip -DestinationPath ${{ github.workspace }}\ninja 129echo "${{ github.workspace }}\ninja" | Out-File -Append -Encoding utf8 -FilePath $Env:GITHUB_PATH 130 131- name : Print ninja version 132run : ninja --version 133 134- name : Target OS 135run : echo -e "\ntarget_os = [\"${{ matrix.target.name }}\"]" >> .gclient 136shell : bash 137working-directory : webrtc-sys/libwebrtc 138 139- name : Build WebRTC 140run : ${{ matrix.target.cmd }} --arch ${{ matrix.target.arch }} --profile ${{ matrix.profile }} ${{ matrix.target.buildargs }} 141working-directory : webrtc-sys/libwebrtc 142 143- name : Zip artifact (Unix) 144if : ${{ matrix.target.os != 'windows-latest' }} 145run : | 146cd webrtc-sys/libwebrtc 147zip ${{ github.workspace }}/${{ steps.setup.outputs.ZIP }} ${{ steps.setup.outputs.OUT }} -r 148 149- name : Zip artifact (Windows) 150if : ${{ matrix.target.os == 'windows-latest' }} 151run : Compress-Archive -Path .\webrtc-sys\libwebrtc\${{ steps.setup.outputs.OUT }} -DestinationPath ${{ steps.setup.outputs.ZIP }} 152 153- name : Upload artifacts 154uses : actions/upload-artifact@v4 155with : 156name : webrtc-builds-${{ steps.setup.outputs.OUT }} 157path : ${{ steps.setup.outputs.ZIP }} 158 159release : 160name : Release to GH (Draft) 161runs-on : ubuntu-latest 162needs : build 163permissions : 164contents : write 165if : startsWith(github.ref, 'refs/tags/webrtc-') 166env : 167GH_TOKEN : ${{ github.token }} 168steps : 169- uses : actions/checkout@v4 170 171- name : Download artifacts 172uses : actions/download-artifact@v4 173with : 174pattern : webrtc-builds-* 175merge-multiple : true 176path : ${{ github.workspace }}/webrtc-builds 177 178- name : Create draft release 179run : | 180 gh release create ${{ github.ref_name }} --draft --title "${{ github.ref_name }}" 181 gh release upload ${{ github.ref_name }} ${{ github.workspace }}/webrtc-builds/*