Skip to content

Commit 791c966

Browse files
authored
Merge pull request #459 from AgoraIO/dev/4.6.0
Dev/4.6.0
2 parents ca70dc2 + 71e4940 commit 791c966

File tree

688 files changed

+26913
-28211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

688 files changed

+26913
-28211
lines changed

.github/ci/build/build_android.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ buildUtils = new agora.build.BuildUtils()
77

88
compileConfig = [
99
"sourceDir": "api-examples",
10-
"docker": "hub.agoralab.co/server/apiexample_build_android:latest",
1110
"non-publish": [
1211
"command": "./.github/ci/build/build_android.sh",
1312
"extraArgs": "",
@@ -64,4 +63,4 @@ def doPublish(buildVariables) {
6463
sh "rm -rf *.zip *.apk || true"
6564
}
6665

67-
pipelineLoad(this, "ApiExample", "build", "android", "apiexample_linux")
66+
pipelineLoad(this, "ApiExample", "build", "android", "RTC-Sample")

.github/ci/build/build_android.sh

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
# pr: output test.zip to workspace dir
3838
# others: Rename the zip package name yourself, But need copy it to workspace dir
3939
##################################
40+
export PATH=$PATH:/opt/homebrew/bin
4041

4142
echo Package_Publish: $Package_Publish
4243
echo is_tag_fetch: $is_tag_fetch
@@ -49,6 +50,8 @@ echo release_version: $release_version
4950
echo short_version: $short_version
5051
echo pwd: `pwd`
5152
echo sdk_url: $sdk_url
53+
echo android_direction: $android_direction
54+
5255
unzip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT
5356
zip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT.zip
5457
if [ -z "$sdk_url" ] || [ "$sdk_url" = "none" ]; then
@@ -63,33 +66,46 @@ else
6366
curl -o $zip_name $sdk_url || exit 1
6467
7za x ./$zip_name -y > log.txt
6568

66-
unzip_name=`ls -S -d */ | grep Agora | sed 's/\///g'`
69+
# Support top-level directory name containing 'Agora' or 'Shengwang'
70+
unzip_name=`ls -S -d */ | grep -E 'Agora|Shengwang' | head -n 1 | sed 's/\///g'`
71+
if [ -z "$unzip_name" ]; then
72+
echo "Error: Unzipped directory not found. The SDK package structure may be invalid or the top-level directory does not contain 'Agora' or 'Shengwang'"
73+
exit 1
74+
fi
6775
echo unzip_name: $unzip_name
6876

6977
rm -rf ./$unzip_name/rtc/bin
7078
rm -rf ./$unzip_name/rtc/demo
71-
rm ./$unzip_name/rtc/commits
72-
rm ./$unzip_name/rtc/package_size_report.txt
79+
rm -f ./$unzip_name/.commits
80+
rm -f ./$unzip_name/spec
7381
rm -rf ./$unzip_name/pom
7482
fi
75-
mkdir -p ./$unzip_name/rtc/samples
76-
cp -rf ./Android/${android_direction} ./$unzip_name/rtc/samples/API-Example || exit 1
83+
84+
mkdir -p ./$unzip_name/rtc/samples/${android_direction} || exit 1
85+
rm -rf ./$unzip_name/rtc/samples/${android_direction}/*
86+
87+
if [ -d "./Android/${android_direction}" ]; then
88+
cp -rf ./Android/${android_direction}/* ./$unzip_name/rtc/samples/${android_direction}/ || exit 1
89+
else
90+
echo "Error: Source directory ./Android/${android_direction} does not exist"
91+
exit 1
92+
fi
93+
7794
7za a -tzip result.zip -r $unzip_name > log.txt
7895
mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name
7996

97+
if [ $compress_apiexample = true ]; then
98+
onlyCodeZipName=${android_direction}_onlyCode.zip
99+
7za a -tzip $onlyCodeZipName -r ./$unzip_name/rtc/samples/${android_direction} >> log.txt
100+
mv $onlyCodeZipName $WORKSPACE/APIExample_onlyCode_${BUILD_NUMBER}_$zip_name
101+
fi
102+
80103
if [ $compile_project = true ]; then
81-
# install android sdk
82-
which java
83-
java --version
84-
source ~/.bashrc
85-
export ANDROID_HOME=/usr/lib/android_sdk
86-
echo ANDROID_HOME: $ANDROID_HOME
87-
cd ./$unzip_name/rtc/samples/API-Example || exit 1
104+
cd ./$unzip_name/rtc/samples/${android_direction} || exit 1
88105
if [ -z "$sdk_url" ] || [ "$sdk_url" = "none" ]; then
89106
./cloud_build.sh false || exit 1
90107
else
91108
./cloud_build.sh true || exit 1
92109
fi
93110
fi
94111

95-

.github/ci/build/build_ios.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ def doPublish(buildVariables) {
5656
sh "rm -rf *.zip *.ipa || true"
5757
}
5858

59-
pipelineLoad(this, "ApiExample", "build", "ios", "apiexample_mac")
59+
pipelineLoad(this, "ApiExample", "build", "ios", "RTC-Sample")

.github/ci/build/build_ios.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
# pr: output test.zip to workspace dir
3939
# others: Rename the zip package name yourself, But need copy it to workspace dir
4040
##################################
41+
export PATH=$PATH:/opt/homebrew/bin
42+
4143
xcode_version=$(xcodebuild -version | grep Xcode | awk '{print $2}')
4244
echo "Xcode Version: $xcode_version"
4345
echo ios_direction: $ios_direction
@@ -61,7 +63,11 @@ export LANG=en_US.UTF-8
6163
unzip_name=Agora_Native_SDK_for_iOS_FULL
6264
zip_name=output.zip
6365
sdk_url_flag=false
64-
if [ -z "$sdk_url" ]; then
66+
apiexample_cn_name=Shengwang_Native_SDK_for_iOS
67+
apiexample_global_name=Agora_Native_SDK_for_iOS
68+
global_dir=Global
69+
70+
if [ -z "$sdk_url" -o "$sdk_url" = "none" ]; then
6571
sdk_url_flag=false
6672
echo "sdk_url is empty"
6773
echo unzip_name: $unzip_name
@@ -74,7 +80,7 @@ else
7480
echo zip_name: $zip_name
7581
curl -o $zip_name $sdk_url || exit 1
7682
7za x ./$zip_name -y > log.txt
77-
unzip_name=`ls -S -d */ | grep Agora | sed 's/\///g'`
83+
unzip_name=`ls -S -d */ | egrep 'Agora|Shengwang' | sed 's/\///g'`
7884
echo unzip_name: $unzip_name
7985
rm -rf ./$unzip_name/bin
8086
rm -f ./$unzip_name/commits
@@ -99,6 +105,26 @@ echo "start move to"
99105
echo $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name
100106
mv result.zip $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name
101107

108+
if [ $compress_apiexample = true ]; then
109+
sdk_version=$(grep "pod 'AgoraRtcEngine_iOS'" ./iOS/${ios_direction}/Podfile | sed -n "s/.*'\([0-9.]*\)'.*/\1/p")
110+
echo "sdk_version: $sdk_version"
111+
112+
cp -rf ./iOS/${ios_direction} $global_dir/
113+
114+
echo "start compress api example"
115+
7za a -tzip global_result.zip $global_dir
116+
echo "complete compress api example"
117+
echo "current path: `pwd`"
118+
ls -al
119+
global_des_path=$WORKSPACE/${apiexample_global_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip
120+
121+
echo "global_des_path: $global_des_path"
122+
echo "Moving global_result.zip to $global_des_path"
123+
mv global_result.zip $global_des_path
124+
125+
ls -al $WORKSPACE/
126+
fi
127+
102128
if [ $compile_project = true ]; then
103129
cd ./$unzip_name/samples/${ios_direction}
104130
./cloud_build.sh || exit 1

.github/ci/build/build_mac.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ def doPublish(buildVariables) {
5050
sh "rm -rf *.zip || true"
5151
}
5252

53-
pipelineLoad(this, "ApiExample", "build", "mac", "apiexample_mac")
53+
pipelineLoad(this, "ApiExample", "build", "mac", "RTC-Sample")

.github/ci/build/build_mac.sh

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
# pr: output test.zip to workspace dir
3838
# others: Rename the zip package name yourself, But need copy it to workspace dir
3939
##################################
40+
export PATH=$PATH:/opt/homebrew/bin
4041

4142
echo compile_project:$compile_project
4243
echo Package_Publish: $Package_Publish
@@ -59,6 +60,10 @@ export LANG=en_US.UTF-8
5960
unzip_name=Agora_Native_SDK_for_iOS_FULL
6061
zip_name=output.zip
6162
sdk_url_flag=false
63+
apiexample_cn_name=Shengwang_Native_SDK_for_Mac
64+
apiexample_global_name=Agora_Native_SDK_for_Mac
65+
cn_dir=CN
66+
global_dir=Global
6267

6368
echo zip_name: $zip_name
6469
if [ -z "$sdk_url" ]; then
@@ -74,7 +79,7 @@ else
7479
echo unzip_name: $unzip_name
7580
curl -o $zip_name $sdk_url || exit 1
7681
7za x ./$zip_name -y > log.txt
77-
unzip_name=`ls -S -d */ | grep Agora`
82+
unzip_name=`ls -S -d */ | egrep 'Agora|Shengwang' | sed 's/\///g'`
7883
echo unzip_name: $unzip_name
7984

8085
rm -rf ./$unzip_name/bin
@@ -92,13 +97,33 @@ else
9297
fi
9398

9499
python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/APIExample/Podfile $sdk_url_flag
100+
101+
echo "start compress"
95102
7za a -tzip result.zip -r $unzip_name
96103
cp result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name
97104

98-
if [ $compile_project = true ]; then
99-
cd ./$unzip_name/samples/APIExample
100-
./cloud_build.sh || exit 1
105+
if [ $compress_apiexample = true ]; then
106+
sdk_version=$(grep "pod 'AgoraRtcEngine_iOS'" ./iOS/${ios_direction}/Podfile | sed -n "s/.*'\([0-9.]*\)'.*/\1/p")
107+
echo "sdk_version: $sdk_version"
108+
109+
mkdir -p $cn_dir $global_dir
110+
cp -rf ./iOS/${ios_direction} $cn_dir/
111+
cp -rf ./iOS/${ios_direction} $global_dir/
112+
cd $cn_dir/${ios_direction}
113+
./cloud_project.sh || exit 1
101114
cd -
102-
fi
115+
echo "start compress api example"
116+
7za a -tzip cn_result.zip $cn_dir > log.txt
117+
7za a -tzip global_result.zip $global_dir > log.txt
118+
119+
mv cn_result.zip $WORKSPACE/${apiexample_cn_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip
120+
mv global_result.zip $WORKSPACE/${apiexample_global_name}_${sdk_version}${BUILD_NUMBER}_APIExample.zip
121+
fi
122+
123+
#if [ $compile_project = true ]; then
124+
# cd ./$unzip_name/samples/APIExample
125+
# ./cloud_build.sh || exit 1
126+
# cd -
127+
#fi
103128

104129

.github/ci/build/modify_ios_keycenter.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
def modfiy(path, isReset):
44
appId = os.environ.get('APP_ID')
5+
faceCaptureLicense = os.environ.get('FACE_CAPTURE_LICENSE')
56
with open(path, 'r', encoding='utf-8') as file:
67
contents = []
78
for num, line in enumerate(file):
@@ -16,6 +17,11 @@ def modfiy(path, isReset):
1617
line = "static let Certificate: String? = <#YOUR Certificate#>"
1718
else:
1819
line = 'static let Certificate: String? = nil'
20+
elif "static let FaceCaptureLicense" in line:
21+
if isReset:
22+
line = "static let FaceCaptureLicense: String? = nil"
23+
else:
24+
line = f'static let FaceCaptureLicense: String? = "{faceCaptureLicense}"'
1925
elif "static NSString * const APPID" in line:
2026
if isReset:
2127
line = "static NSString * const APPID = <#YOUR APPID#>"

.github/workflows/gitee-sync-shell.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/gitee-sync.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/modify_podfile.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)