|
| 1 | +name: Build WebRTC |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + hash: |
| 6 | + description: 'WebRTC hash' |
| 7 | + required: true |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: macos-latest |
| 11 | + steps: |
| 12 | + - env: |
| 13 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 14 | + HASH: ${{ github.event.inputs.hash }} |
| 15 | + run: | |
| 16 | + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 17 | + export PATH=${PATH}:${PWD}/depot_tools |
| 18 | + |
| 19 | + fetch --nohooks webrtc_ios |
| 20 | + |
| 21 | + cd src |
| 22 | + |
| 23 | + git checkout ${HASH} |
| 24 | + |
| 25 | + gclient sync |
| 26 | + |
| 27 | + export OUTPUT_DIR=${TMPDIR}${HASH} |
| 28 | + |
| 29 | + gn gen ${OUTPUT_DIR}/mac_x64 --args='target_os="mac" target_cpu="x64" is_component_build=false is_debug=false rtc_libvpx_build_vp9=false enable_stripping=true rtc_enable_protobuf=false' |
| 30 | + gn gen ${OUTPUT_DIR}/ios_x64 --args='target_os="ios" target_cpu="x64" is_component_build=false use_xcode_clang=true is_debug=true ios_deployment_target="10.0" rtc_libvpx_build_vp9=false use_goma=false ios_enable_code_signing=false enable_stripping=true rtc_enable_protobuf=false enable_ios_bitcode=false treat_warnings_as_errors=false' |
| 31 | + gn gen ${OUTPUT_DIR}/ios_arm64 --args='target_os="ios" target_cpu="arm64" is_component_build=false use_xcode_clang=true is_debug=false ios_deployment_target="10.0" rtc_libvpx_build_vp9=false use_goma=false ios_enable_code_signing=false enable_stripping=true rtc_enable_protobuf=false enable_ios_bitcode=false treat_warnings_as_errors=false' |
| 32 | +
|
| 33 | + ninja -C ${OUTPUT_DIR}/mac_x64 sdk:mac_framework_objc |
| 34 | + ninja -C ${OUTPUT_DIR}/ios_x64 sdk:framework_objc |
| 35 | + ninja -C ${OUTPUT_DIR}/ios_arm64 sdk:framework_objc |
| 36 | + |
| 37 | + xcodebuild -create-xcframework \ |
| 38 | + -framework ${OUTPUT_DIR}/mac_x64/WebRTC.framework \ |
| 39 | + -framework ${OUTPUT_DIR}/ios_x64/WebRTC.framework \ |
| 40 | + -framework ${OUTPUT_DIR}/ios_arm64/WebRTC.framework \ |
| 41 | + -output ${OUTPUT_DIR}/WebRTC.xcframework |
| 42 | + |
| 43 | + cd ${OUTPUT_DIR} |
| 44 | + |
| 45 | + git init |
| 46 | + git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" |
| 47 | + git pull origin main |
| 48 | +
|
| 49 | + git checkout -b release/${HASH} |
| 50 | + git add WebRTC.xcframework |
| 51 | + git commit -m "WebRTC release ${HASH}" -- WebRTC.xcframework |
| 52 | + git push --set-upstream origin "release/${HASH}" |
0 commit comments