Skip to content

Commit 8ebd8d8

Browse files
authored
Merge pull request #1 from Bandwidth/dev
Build WebRTC framework
2 parents b8318c3 + b068cf6 commit 8ebd8d8

File tree

4 files changed

+105
-1
lines changed

4 files changed

+105
-1
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

Package.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// swift-tools-version:5.3
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "webrtc",
8+
products: [
9+
// Products define the executables and libraries a package produces, and make them visible to other packages.
10+
.library(
11+
name: "WebRTC",
12+
targets: ["WebRTC"]),
13+
],
14+
dependencies: [
15+
// Dependencies declare other packages that this package depends on.
16+
// .package(url: /* package url */, from: "1.0.0"),
17+
],
18+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
19+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
20+
targets: [
21+
.binaryTarget(name: "WebRTC",
22+
path: "WebRTC.xcframework")
23+
]
24+
)

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
# webrtc-swift-temp
1+
# WebRTC
2+
3+
This is the [WebRTC](https://webrtc.googlesource.com/src) framework using the XCFramework bundle type for iOS and macOS.
4+
5+
## Installation
6+
7+
### Swift Package Manager
8+
9+
Requires Swift 5.3
10+
11+
#### Package.swift
12+
13+
Add https://github.com/Bandwidth/webrtc-swift.git as a dependency to your Package.swift file.
14+
15+
```swift
16+
dependencies: [
17+
.package(url: "https://github.com/Bandwidth/webrtc-swift.git", .upToNextMajor(from: "1.0.0"))
18+
]
19+
```
20+
21+
#### Xcode
22+
23+
Add https://github.com/Bandwidth/webrtc-swift.git using Xcode > File > Swift Packages > Add Package Dependency...
24+
25+
## Resources
26+
27+
* [WebRTC site](https://webrtc.org/)
28+
* [WebRTC source](https://webrtc.googlesource.com/src)

0 commit comments

Comments
 (0)