From 7d08dde276c5db07286a64a9da964152c93cbc21 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Wed, 30 Oct 2024 18:37:19 +0800 Subject: [PATCH 01/10] Modify the script and add SDK link empty judgment --- .github/ci/build/build_ios.sh | 35 +++++++++++++++++------------- .github/ci/build/modify_podfile.py | 14 +++++++----- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index 07517f9eb..3dfa54b1d 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -53,27 +53,32 @@ echo short_version: $short_version echo pwd: `pwd` echo sdk_url: $sdk_url -zip_name=${sdk_url##*/} -echo zip_name: $zip_name - -curl -o $zip_name $sdk_url || exit 1 -7za x ./$zip_name -y > log.txt - -unzip_name=`ls -S -d */ | grep Agora | sed 's/\///g'` -echo unzip_name: $unzip_name - -rm -rf ./$unzip_name/bin -rm ./$unzip_name/commits -rm ./$unzip_name/package_size_report.txt -mkdir ./$unzip_name/samples +unzip_name=Agora_Native_SDK_for_iOS_FULL +sdk_url_flag=false +if [ -z "$sdk_url" ]; then + sdk_url_flag=false + echo "sdk_url is empty" + echo unzip_name: $unzip_name +else + sdk_url_flag=true + zip_name=${sdk_url##*/} + echo zip_name: $zip_name + curl -o $zip_name $sdk_url || exit 1 + 7za x ./$zip_name -y > log.txt + unzip_name=`ls -S -d */ | grep Agora | sed 's/\///g'` + echo unzip_name: $unzip_name + rm -rf ./$unzip_name/bin + rm ./$unzip_name/commits + rm ./$unzip_name/package_size_report.txt +fi +mkdir -p ./$unzip_name/samples cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/API-Example || exit 1 ls -al ./$unzip_name/samples/API-Example/ mv ./$unzip_name/samples/API-Example/sdk.podspec ./$unzip_name/ || exit 1 echo "work space1: $WORKSPACE" -python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile || exit 1 - +python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile $sdk_url_flag || exit 1 7za a -tzip result.zip -r $unzip_name > log.txt mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name diff --git a/.github/ci/build/modify_podfile.py b/.github/ci/build/modify_podfile.py index c9ad317ec..787d9c7a8 100644 --- a/.github/ci/build/modify_podfile.py +++ b/.github/ci/build/modify_podfile.py @@ -1,13 +1,15 @@ import os, sys -def modfiy(path): +def modfiy(path, sdk_flag): with open(path, 'r', encoding='utf-8') as file: contents = [] for num, line in enumerate(file): if "pod 'Agora" in line: - line = '\t'+"pod 'sdk', :path => '../../sdk.podspec'" + "\n" + if sdk_flag: + line = '\t'+"pod 'sdk', :path => '../../sdk.podspec'" + "\n" elif "pod 'sdk" in line: - line = "" + if sdk_flag: + line = "" elif 'sh .download_script' in line: line = line.replace('true', 'false') + "\n" contents.append(line) @@ -19,6 +21,8 @@ def modfiy(path): fw.close() + if __name__ == '__main__': - path = sys.argv[1:][0] - modfiy(path.strip()) + path = sys.argv[1] + sdk_url_is_not_empty = sys.argv[2].lower() == 'true' + modfiy(path.strip(), sdk_url_is_not_empty) From e3a646ba762628ba2613e9ec2abf39ac948196ff Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Wed, 30 Oct 2024 18:54:57 +0800 Subject: [PATCH 02/10] Use the old version of SDK to test CI --- iOS/APIExample/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS/APIExample/Podfile b/iOS/APIExample/Podfile index 54f98ffb2..dc8db14e6 100644 --- a/iOS/APIExample/Podfile +++ b/iOS/APIExample/Podfile @@ -4,7 +4,7 @@ #source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' def common_pods - pod 'AgoraRtcEngine_iOS', '4.5.0' + pod 'AgoraRtcEngine_iOS', '4.3.2' #pod 'sdk', :path => 'sdk.podspec' end From 352da815e542ccdf5b6992376f9616705b8a8f85 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Wed, 30 Oct 2024 19:11:42 +0800 Subject: [PATCH 03/10] Verification SDK link is empty --- iOS/APIExample/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS/APIExample/Podfile b/iOS/APIExample/Podfile index dc8db14e6..2fc8f3ff2 100644 --- a/iOS/APIExample/Podfile +++ b/iOS/APIExample/Podfile @@ -4,7 +4,7 @@ #source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' def common_pods - pod 'AgoraRtcEngine_iOS', '4.3.2' + pod 'AgoraRtcEngine_iOS', '4.5.0.test' #pod 'sdk', :path => 'sdk.podspec' end From ae30a80f4fb364840e0c94e2cfd354d49afbe811 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Wed, 30 Oct 2024 19:21:57 +0800 Subject: [PATCH 04/10] Modify the pod script --- iOS/APIExample/cloud_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS/APIExample/cloud_build.sh b/iOS/APIExample/cloud_build.sh index e784bbc55..876662738 100755 --- a/iOS/APIExample/cloud_build.sh +++ b/iOS/APIExample/cloud_build.sh @@ -40,7 +40,7 @@ echo "work space: $WORKSPACE" echo "project path: $PROJECT_PATH" -pod install || exit 1 +pod install --repo-update || exit 1 # 打包环境 CONFIGURATION="Debug" From 7201e1afd768ca8e81041d96095273897c4517d9 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Wed, 30 Oct 2024 19:45:21 +0800 Subject: [PATCH 05/10] Modify script --- .github/ci/build/build_ios.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index 3dfa54b1d..02de319d5 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -59,6 +59,9 @@ if [ -z "$sdk_url" ]; then sdk_url_flag=false echo "sdk_url is empty" echo unzip_name: $unzip_name + mkdir -p ./$unzip_name/samples + cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/API-Example || exit 1 + ls -al ./$unzip_name/samples/API-Example/ else sdk_url_flag=true zip_name=${sdk_url##*/} @@ -70,17 +73,19 @@ else rm -rf ./$unzip_name/bin rm ./$unzip_name/commits rm ./$unzip_name/package_size_report.txt + mkdir -p ./$unzip_name/samples + cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/API-Example || exit 1 + ls -al ./$unzip_name/samples/API-Example/ + mv ./$unzip_name/samples/API-Example/sdk.podspec ./$unzip_name/ || exit 1 fi -mkdir -p ./$unzip_name/samples -cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/API-Example || exit 1 -ls -al ./$unzip_name/samples/API-Example/ -mv ./$unzip_name/samples/API-Example/sdk.podspec ./$unzip_name/ || exit 1 - echo "work space1: $WORKSPACE" python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile $sdk_url_flag || exit 1 +echo "start compress" 7za a -tzip result.zip -r $unzip_name > log.txt +echo "start move to" +echo $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name if [ $compile_project = true ]; then From b4c09cb876df210389d420bcbbcc2a07018bce1c Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Wed, 30 Oct 2024 20:30:48 +0800 Subject: [PATCH 06/10] Modify script --- .github/ci/build/build_ios.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index 02de319d5..407e4dac7 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -54,6 +54,7 @@ echo pwd: `pwd` echo sdk_url: $sdk_url unzip_name=Agora_Native_SDK_for_iOS_FULL +zip_name=output.zip sdk_url_flag=false if [ -z "$sdk_url" ]; then sdk_url_flag=false From efcf47bfe0eb90dcc847219ba28b3e1576b27cda Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Thu, 31 Oct 2024 10:33:07 +0800 Subject: [PATCH 07/10] Modify podfile --- iOS/APIExample/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS/APIExample/Podfile b/iOS/APIExample/Podfile index 2fc8f3ff2..54f98ffb2 100644 --- a/iOS/APIExample/Podfile +++ b/iOS/APIExample/Podfile @@ -4,7 +4,7 @@ #source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' def common_pods - pod 'AgoraRtcEngine_iOS', '4.5.0.test' + pod 'AgoraRtcEngine_iOS', '4.5.0' #pod 'sdk', :path => 'sdk.podspec' end From 81e0ecc1aebeea2d7559eeda9340fa05428491ab Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Thu, 31 Oct 2024 10:42:26 +0800 Subject: [PATCH 08/10] Read the directory from the parameters --- .github/ci/build/build_ios.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index 407e4dac7..afd0db329 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -61,8 +61,8 @@ if [ -z "$sdk_url" ]; then echo "sdk_url is empty" echo unzip_name: $unzip_name mkdir -p ./$unzip_name/samples - cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/API-Example || exit 1 - ls -al ./$unzip_name/samples/API-Example/ + cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/${ios_direction} || exit 1 + ls -al ./$unzip_name/samples/${ios_direction}/ else sdk_url_flag=true zip_name=${sdk_url##*/} @@ -75,13 +75,13 @@ else rm ./$unzip_name/commits rm ./$unzip_name/package_size_report.txt mkdir -p ./$unzip_name/samples - cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/API-Example || exit 1 - ls -al ./$unzip_name/samples/API-Example/ - mv ./$unzip_name/samples/API-Example/sdk.podspec ./$unzip_name/ || exit 1 + cp -rf ./iOS/${ios_direction} ./$unzip_name/samples/${ios_direction} || exit 1 + ls -al ./$unzip_name/samples/${ios_direction}/ + mv ./$unzip_name/samples/${ios_direction}/sdk.podspec ./$unzip_name/ || exit 1 fi echo "work space1: $WORKSPACE" -python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/API-Example/Podfile $sdk_url_flag || exit 1 +python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/${ios_direction}/Podfile $sdk_url_flag || exit 1 echo "start compress" 7za a -tzip result.zip -r $unzip_name > log.txt @@ -90,7 +90,7 @@ echo $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name if [ $compile_project = true ]; then - cd ./$unzip_name/samples/API-Example + cd ./$unzip_name/samples/${ios_direction} ./cloud_build.sh || exit 1 cd - fi From 1a8f63abae7e3ea0f7d77745910d5f0e66f40385 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Thu, 31 Oct 2024 10:47:14 +0800 Subject: [PATCH 09/10] Change the file name --- .github/ci/build/build_ios.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index afd0db329..36a48a0da 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -86,8 +86,8 @@ python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/${ios_directi echo "start compress" 7za a -tzip result.zip -r $unzip_name > log.txt echo "start move to" -echo $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name -mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name +echo $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name +mv result.zip $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name if [ $compile_project = true ]; then cd ./$unzip_name/samples/${ios_direction} From 70f247ac9c7f4271ad25fd77de267b989b22d2f5 Mon Sep 17 00:00:00 2001 From: qinhui <> Date: Thu, 31 Oct 2024 11:14:50 +0800 Subject: [PATCH 10/10] Modify build script for mac --- .github/ci/build/build_mac.sh | 45 ++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/.github/ci/build/build_mac.sh b/.github/ci/build/build_mac.sh index 00444a1ee..a9c0fa1ee 100644 --- a/.github/ci/build/build_mac.sh +++ b/.github/ci/build/build_mac.sh @@ -51,26 +51,37 @@ echo short_version: $short_version echo pwd: `pwd` echo sdk_url: $sdk_url -zip_name=${sdk_url##*/} -echo zip_name: $zip_name - -curl -o $zip_name $sdk_url || exit 1 -7za x ./$zip_name -y > log.txt - -unzip_name=`ls -S -d */ | grep Agora` -echo unzip_name: $unzip_name - -rm -rf ./$unzip_name/bin -rm ./$unzip_name/commits -rm ./$unzip_name/package_size_report.txt -mkdir ./$unzip_name/samples +unzip_name=Agora_Native_SDK_for_iOS_FULL +zip_name=output.zip +sdk_url_flag=false +echo zip_name: $zip_name +if [ -z "$sdk_url" ]; then + sdk_url_flag=false + echo "sdk_url is empty" + echo unzip_name: $unzip_name + mkdir ./$unzip_name/samples + cp -rf ./macOS ./$unzip_name/samples/APIExample || exit 1 + ls -al ./$unzip_name/samples/API-Example/ +else + sdk_url_flag=true + zip_name=${sdk_url##*/} + echo unzip_name: $unzip_name + curl -o $zip_name $sdk_url || exit 1 + 7za x ./$zip_name -y > log.txt + unzip_name=`ls -S -d */ | grep Agora` + echo unzip_name: $unzip_name -cp -rf ./macOS ./$unzip_name/samples/APIExample || exit 1 -ls -al ./$unzip_name/samples/API-Example/ -mv ./$unzip_name/samples/APIExample/sdk.podspec ./$unzip_name/ -python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/APIExample/Podfile + rm -rf ./$unzip_name/bin + rm ./$unzip_name/commits + rm ./$unzip_name/package_size_report.txt + mkdir ./$unzip_name/samples + cp -rf ./macOS ./$unzip_name/samples/APIExample || exit 1 + ls -al ./$unzip_name/samples/API-Example/ + mv ./$unzip_name/samples/APIExample/sdk.podspec ./$unzip_name/ +fi +python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/APIExample/Podfile $sdk_url_flag 7za a -tzip result.zip -r $unzip_name cp result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name