-
Notifications
You must be signed in to change notification settings - Fork 29
Fix Apple and Android tools for m137 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c9dc603
Fix mocks patch
pblazej 0497c0c
Use autoninja everywhere
pblazej ce49b4f
Old apple infra
pblazej 4cf38df
Fix mac build, upload
pblazej 8319698
Update jni_prefix.patch for m137
davidliu c135d29
Update version and set commit to 137 branch for testing
davidliu b1b5fef
Full Apple script
pblazej cce6a92
Fix paths
pblazej b0ea15f
Pass framework name
pblazej 537fc6c
Absolute paths
pblazej f18bbb5
Revert: iOS only
pblazej e43106a
Fix paths alt
pblazej a0baabc
Other platforms
pblazej 3f158cc
Fix artifact name
pblazej c7010dc
Shellcheck
pblazej 9c832f8
Fix constant prefix
pblazej 4d23678
Script cosmetics
pblazej 925aa7e
Apple release asset
pblazej 0cda6c6
Don't zip
pblazej 34037e6
Revert "Don't zip"
pblazej 79b6593
Permissions
pblazej 1e52c2d
Pin release branch
pblazej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,10 @@ on: | |
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
actions: read | ||
|
||
jobs: | ||
# build-windows: | ||
# defaults: | ||
|
@@ -54,29 +58,30 @@ jobs: | |
# with: | ||
# name: webrtc.${{ matrix.name }}.zip | ||
# path: build\_package\${{ matrix.name }}\webrtc.zip | ||
# build-macos: | ||
# defaults: | ||
# run: | ||
# working-directory: ./build | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# name: | ||
# - macos_arm64 | ||
# - macos_x86_64 | ||
# - ios | ||
# runs-on: macos-11 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Select Xcode 13.0 | ||
# run: sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer | ||
# - run: brew install ninja | ||
# - run: ./build.${{ matrix.name }}.sh "${{ github.event.inputs.commitHash }}" | ||
# - name: Upload Artifact | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: webrtc.${{ matrix.name }}.tar.gz | ||
# path: build/_package/${{ matrix.name }}/webrtc.tar.gz | ||
build-apple: | ||
defaults: | ||
run: | ||
working-directory: ./build | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
name: | ||
- apple | ||
- apple_prefixed | ||
runs-on: macos-15-xlarge | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: 16.4 | ||
- name: Build | ||
id: build | ||
run: ./build.${{ matrix.name }}.sh "${{ github.event.inputs.commitHash }}" | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.build.outputs.framework_name }}.xcframework | ||
path: build/_package/${{ matrix.name }}/${{ steps.build.outputs.framework_name }}.xcframework.zip | ||
build-linux: | ||
defaults: | ||
run: | ||
|
@@ -119,7 +124,7 @@ jobs: | |
if: contains(github.ref, 'tags/m') | ||
needs: | ||
# - build-windows | ||
# - build-macos | ||
- build-apple | ||
- build-linux | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
|
@@ -187,6 +192,41 @@ jobs: | |
asset_path: webrtc.${{ matrix.name }}.tar.gz/webrtc.tar.gz | ||
asset_name: webrtc.${{ matrix.name }}.tar.gz | ||
asset_content_type: application/gzip | ||
upload-assets-apple: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
name: | ||
- WebRTC.xcframework | ||
- LiveKitWebRTC.xcframework | ||
name: Release ${{ matrix.name }} | ||
if: contains(github.ref, 'tags/m') | ||
needs: | ||
- create-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download ${{ matrix.name }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ matrix.name }} | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: create-release.env | ||
- name: Env to output | ||
shell: bash | ||
run: | | ||
source create-release.env/create-release.env | ||
echo "upload_url=$UPLOAD_URL" >> "$GITHUB_OUTPUT" | ||
id: env | ||
- name: Upload ${{ matrix.name }} Release Asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.env.outputs.upload_url }} | ||
asset_path: ${{ matrix.name }}.zip | ||
asset_name: ${{ matrix.name }} | ||
asset_content_type: application/zip | ||
# Windows だけ Content-Type が違うので別で記述する | ||
# Windows has a different Content-Type, so handle it separately. | ||
# upload-assets-windows: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
WEBRTC_BUILD_VERSION=125.6422.07.0 | ||
WEBRTC_VERSION=125.6422.07 | ||
WEBRTC_READABLE_VERSION=M125.6422@{#7} | ||
WEBRTC_COMMIT=c4b376ac375710de19c1ba20157dba9b065930b0 | ||
WEBRTC_BUILD_VERSION=137.7151.00.0 | ||
WEBRTC_VERSION=137.7151.00 | ||
WEBRTC_READABLE_VERSION=M137.7151@{#0} | ||
WEBRTC_COMMIT=m137_release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -z "$1" ]]; then | ||
echo "Usage: $0 'debug' | 'release' 'source_dir' 'out_dir' ['prefix']" | ||
exit 0 | ||
fi | ||
|
||
MODE="$1" | ||
SOURCE_DIR="$(realpath "$2")" | ||
OUT_DIR="$(realpath "$3")" | ||
PREFIX="${4:-""}" | ||
|
||
if [ -z "$PREFIX" ]; then | ||
FRAMEWORK_NAME="WebRTC" | ||
else | ||
FRAMEWORK_NAME="${PREFIX}WebRTC" | ||
fi | ||
|
||
DEBUG="false" | ||
if [[ "$MODE" == "debug" ]]; then | ||
DEBUG="true" | ||
fi | ||
|
||
PARALLEL_BUILDS=6 | ||
|
||
echo "xcframework.sh: MODE=$MODE, DEBUG=$DEBUG, SOURCE_DIR=$SOURCE_DIR, OUT_DIR=$OUT_DIR, PREFIX=$PREFIX, FRAMEWORK_NAME=$FRAMEWORK_NAME" | ||
|
||
start_group() { | ||
if [[ "$CI" == "true" ]]; then | ||
echo "::group::$1" | ||
else | ||
echo "=== $1 ===" | ||
fi | ||
} | ||
|
||
end_group() { | ||
if [[ "$CI" == "true" ]]; then | ||
echo "::endgroup::" | ||
fi | ||
} | ||
|
||
COMMON_ARGS=" | ||
enable_dsyms = $DEBUG | ||
enable_libaom = true | ||
enable_stripping = true | ||
ios_enable_code_signing = false | ||
is_component_build = false | ||
is_debug = $DEBUG | ||
rtc_build_examples = false | ||
rtc_enable_protobuf = false | ||
rtc_enable_symbol_export = true | ||
rtc_include_dav1d_in_internal_decoder_factory = true | ||
rtc_include_tests = false | ||
rtc_libvpx_build_vp9 = true | ||
rtc_use_h264 = false | ||
treat_warnings_as_errors = true | ||
use_rtti = true" | ||
|
||
PLATFORMS=( | ||
"iOS-arm64-device:target_os=\"ios\" target_environment=\"device\" target_cpu=\"arm64\" ios_deployment_target=\"13.0\"" | ||
"iOS-arm64-simulator:target_os=\"ios\" target_environment=\"simulator\" target_cpu=\"arm64\" ios_deployment_target=\"13.0\"" | ||
"iOS-x64-simulator:target_os=\"ios\" target_environment=\"simulator\" target_cpu=\"x64\" ios_deployment_target=\"13.0\"" | ||
"macOS-arm64:target_os=\"mac\" target_cpu=\"arm64\" mac_deployment_target=\"10.15\"" | ||
"macOS-x64:target_os=\"mac\" target_cpu=\"x64\" mac_deployment_target=\"10.15\"" | ||
"catalyst-arm64:target_os=\"ios\" target_environment=\"catalyst\" target_cpu=\"arm64\" ios_deployment_target=\"14.0\"" | ||
"catalyst-x64:target_os=\"ios\" target_environment=\"catalyst\" target_cpu=\"x64\" ios_deployment_target=\"14.0\"" | ||
"tvOS-arm64-device:target_os=\"ios\" target_environment=\"appletv\" target_cpu=\"arm64\" ios_deployment_target=\"17.0\"" | ||
"tvOS-arm64-simulator:target_os=\"ios\" target_environment=\"appletvsimulator\" target_cpu=\"arm64\" ios_deployment_target=\"17.0\"" | ||
"xrOS-arm64-device:target_os=\"ios\" target_environment=\"xrdevice\" target_cpu=\"arm64\" ios_deployment_target=\"2.2.0\"" | ||
"xrOS-arm64-simulator:target_os=\"ios\" target_environment=\"xrsimulator\" target_cpu=\"arm64\" ios_deployment_target=\"2.2.0\"" | ||
) | ||
|
||
cd "$SOURCE_DIR" | ||
|
||
end_group | ||
|
||
for platform_config in "${PLATFORMS[@]}"; do | ||
platform="${platform_config%%:*}" | ||
config="${platform_config#*:}" | ||
|
||
start_group "Building $platform" | ||
|
||
gn gen "$OUT_DIR/$platform" --args="$COMMON_ARGS $config" --ide=xcode | ||
|
||
if [[ $platform == *"macOS"* ]]; then | ||
build_target="mac_framework_bundle" | ||
else | ||
build_target="ios_framework_bundle" | ||
fi | ||
|
||
ninja -C "$OUT_DIR/$platform" "$build_target" -j $PARALLEL_BUILDS --quiet || exit 1 | ||
end_group | ||
done | ||
|
||
start_group "Creating universal binaries (x64 + arm64)" | ||
|
||
mkdir -p "$OUT_DIR/macOS-lib" | ||
cp -R "$OUT_DIR/macOS-x64/$FRAMEWORK_NAME.framework" "$OUT_DIR/macOS-lib/$FRAMEWORK_NAME.framework" | ||
lipo -create -output "$OUT_DIR/macOS-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/macOS-arm64/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/macOS-x64/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" | ||
|
||
mkdir -p "$OUT_DIR/catalyst-lib" | ||
cp -R "$OUT_DIR/catalyst-arm64/$FRAMEWORK_NAME.framework" "$OUT_DIR/catalyst-lib/$FRAMEWORK_NAME.framework" | ||
lipo -create -output "$OUT_DIR/catalyst-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/catalyst-arm64/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/catalyst-x64/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" | ||
|
||
mkdir -p "$OUT_DIR/iOS-device-lib" | ||
cp -R "$OUT_DIR/iOS-arm64-device/$FRAMEWORK_NAME.framework" "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework" | ||
lipo -create -output "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/iOS-arm64-device/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" | ||
|
||
mkdir -p "$OUT_DIR/iOS-simulator-lib" | ||
cp -R "$OUT_DIR/iOS-arm64-simulator/$FRAMEWORK_NAME.framework" "$OUT_DIR/iOS-simulator-lib/$FRAMEWORK_NAME.framework" | ||
lipo -create -output "$OUT_DIR/iOS-simulator-lib/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/iOS-arm64-simulator/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" "$OUT_DIR/iOS-x64-simulator/$FRAMEWORK_NAME.framework/$FRAMEWORK_NAME" | ||
|
||
end_group | ||
|
||
start_group "Creating XCFramework" | ||
|
||
xcodebuild -create-xcframework \ | ||
-framework "$OUT_DIR/iOS-device-lib/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/iOS-simulator-lib/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/macOS-lib/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/catalyst-lib/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/tvOS-arm64-device/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/tvOS-arm64-simulator/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/xrOS-arm64-device/$FRAMEWORK_NAME.framework" \ | ||
-framework "$OUT_DIR/xrOS-arm64-simulator/$FRAMEWORK_NAME.framework" \ | ||
-output "$OUT_DIR/$FRAMEWORK_NAME.xcframework" | ||
|
||
end_group | ||
|
||
start_group "Post-processing XCFramework" | ||
|
||
cp LICENSE "$OUT_DIR/$FRAMEWORK_NAME.xcframework/" | ||
|
||
cd "$OUT_DIR/$FRAMEWORK_NAME.xcframework/macos-arm64_x86_64/$FRAMEWORK_NAME.framework/" | ||
mv "$FRAMEWORK_NAME" "Versions/A/$FRAMEWORK_NAME" | ||
ln -s "Versions/Current/$FRAMEWORK_NAME" "$FRAMEWORK_NAME" | ||
|
||
cd "$OUT_DIR/$FRAMEWORK_NAME.xcframework/ios-arm64_x86_64-maccatalyst/$FRAMEWORK_NAME.framework/" | ||
mv "$FRAMEWORK_NAME" "Versions/A/$FRAMEWORK_NAME" | ||
ln -s "Versions/Current/$FRAMEWORK_NAME" "$FRAMEWORK_NAME" | ||
|
||
cd "$OUT_DIR" | ||
zip --symlinks -9 -r "$FRAMEWORK_NAME.xcframework.zip" "$FRAMEWORK_NAME.xcframework" | ||
|
||
end_group | ||
|
||
if [[ "$CI" == "true" ]]; then | ||
echo "framework_name=$FRAMEWORK_NAME" >> "$GITHUB_OUTPUT" | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd `dirname $0` | ||
python3 run.py build apple --commit "$1" --webrtc-fetch | ||
|
||
export PATH="$PWD/_source/apple/depot_tools:$PATH" | ||
mkdir -p _package/apple | ||
. apple/xcframework.sh release _source/apple/webrtc/src _package/apple |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd `dirname $0` | ||
python3 run.py build apple_prefixed --commit "$1" --webrtc-fetch | ||
|
||
export PATH="$PWD/_source/apple_prefixed/depot_tools:$PATH" | ||
mkdir -p _package/apple_prefixed | ||
. apple/xcframework.sh release _source/apple_prefixed/webrtc/src _package/apple_prefixed LiveKit # prefix |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.