diff --git a/.github/ci/build/build_ios.groovy b/.github/ci/build/build_ios.groovy index b5bb5f63f..2a772435e 100644 --- a/.github/ci/build/build_ios.groovy +++ b/.github/ci/build/build_ios.groovy @@ -56,4 +56,4 @@ def doPublish(buildVariables) { sh "rm -rf *.zip *.ipa || true" } -pipelineLoad(this, "ApiExample", "build", "ios", "apiexample_mac") \ No newline at end of file +pipelineLoad(this, "ApiExample", "build", "ios", "RTC-Sample") \ No newline at end of file diff --git a/.github/ci/build/build_ios.sh b/.github/ci/build/build_ios.sh index 619315616..3246b86bc 100644 --- a/.github/ci/build/build_ios.sh +++ b/.github/ci/build/build_ios.sh @@ -38,6 +38,8 @@ # pr: output test.zip to workspace dir # others: Rename the zip package name yourself, But need copy it to workspace dir ################################## +export PATH=$PATH:/opt/homebrew/bin + xcode_version=$(xcodebuild -version | grep Xcode | awk '{print $2}') echo "Xcode Version: $xcode_version" echo ios_direction: $ios_direction @@ -61,6 +63,12 @@ export LANG=en_US.UTF-8 unzip_name=Agora_Native_SDK_for_iOS_FULL zip_name=output.zip sdk_url_flag=false +apiexample_cn_name=Shengwang_Native_SDK_for_iOS +apiexample_global_name=Agora_Native_SDK_for_iOS +cn_dir=CN +global_dir=Global + + if [ -z "$sdk_url" ]; then sdk_url_flag=false echo "sdk_url is empty" @@ -99,6 +107,35 @@ echo "start move to" echo $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name mv result.zip $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name +if [ $compress_apiexample = true ]; then + sdk_version=$(grep "pod 'AgoraRtcEngine_iOS'" ./iOS/${ios_direction}/Podfile | sed -n "s/.*'\([0-9.]*\)'.*/\1/p") + echo "sdk_version: $sdk_version" + + mkdir -p $cn_dir $global_dir + cp -rf ./iOS/${ios_direction} $cn_dir/ + cp -rf ./iOS/${ios_direction} $global_dir/ + cd $cn_dir/${ios_direction} + ./cloud_project.sh || exit 1 + cd - + echo "start compress api example" + 7za a -tzip cn_result.zip $cn_dir + 7za a -tzip global_result.zip $global_dir + echo "complete compress api example" + echo "current path: `pwd`" + ls -al + cn_des_path=$WORKSPACE/${apiexample_cn_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip + global_des_path=$WORKSPACE/${apiexample_global_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip + echo "cn_des_path: $cn_des_path" + echo "Moving cn_result.zip to $cn_des_path" + mv cn_result.zip $cn_des_path + + echo "global_des_path: $global_des_path" + echo "Moving global_result.zip to $global_des_path" + mv global_result.zip $global_des_path + + ls -al $WORKSPACE/ +fi + if [ $compile_project = true ]; then cd ./$unzip_name/samples/${ios_direction} ./cloud_build.sh || exit 1 diff --git a/.github/ci/build/build_mac.groovy b/.github/ci/build/build_mac.groovy index 7760a16f8..93923911b 100644 --- a/.github/ci/build/build_mac.groovy +++ b/.github/ci/build/build_mac.groovy @@ -50,4 +50,4 @@ def doPublish(buildVariables) { sh "rm -rf *.zip || true" } -pipelineLoad(this, "ApiExample", "build", "mac", "apiexample_mac") \ No newline at end of file +pipelineLoad(this, "ApiExample", "build", "mac", "RTC-Sample") \ No newline at end of file diff --git a/.github/ci/build/build_mac.sh b/.github/ci/build/build_mac.sh index 5c48c25f3..9c45a9679 100644 --- a/.github/ci/build/build_mac.sh +++ b/.github/ci/build/build_mac.sh @@ -37,6 +37,7 @@ # pr: output test.zip to workspace dir # others: Rename the zip package name yourself, But need copy it to workspace dir ################################## +export PATH=$PATH:/opt/homebrew/bin echo compile_project:$compile_project echo Package_Publish: $Package_Publish @@ -59,6 +60,10 @@ export LANG=en_US.UTF-8 unzip_name=Agora_Native_SDK_for_iOS_FULL zip_name=output.zip sdk_url_flag=false +apiexample_cn_name=Shengwang_Native_SDK_for_Mac +apiexample_global_name=Agora_Native_SDK_for_Mac +cn_dir=CN +global_dir=Global echo zip_name: $zip_name if [ -z "$sdk_url" ]; then @@ -92,13 +97,33 @@ else fi python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/APIExample/Podfile $sdk_url_flag + +echo "start compress" 7za a -tzip result.zip -r $unzip_name cp result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name -if [ $compile_project = true ]; then - cd ./$unzip_name/samples/APIExample - ./cloud_build.sh || exit 1 +if [ $compress_apiexample = true ]; then + sdk_version=$(grep "pod 'AgoraRtcEngine_iOS'" ./iOS/${ios_direction}/Podfile | sed -n "s/.*'\([0-9.]*\)'.*/\1/p") + echo "sdk_version: $sdk_version" + + mkdir -p $cn_dir $global_dir + cp -rf ./iOS/${ios_direction} $cn_dir/ + cp -rf ./iOS/${ios_direction} $global_dir/ + cd $cn_dir/${ios_direction} + ./cloud_project.sh || exit 1 cd - -fi + echo "start compress api example" + 7za a -tzip cn_result.zip $cn_dir > log.txt + 7za a -tzip global_result.zip $global_dir > log.txt + + mv cn_result.zip $WORKSPACE/${apiexample_cn_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip + mv global_result.zip $WORKSPACE/${apiexample_global_name}_${sdk_version}${BUILD_NUMBER}_APIExample.zip +fi + +#if [ $compile_project = true ]; then +# cd ./$unzip_name/samples/APIExample +# ./cloud_build.sh || exit 1 +# cd - +#fi diff --git a/iOS/.gitignore b/iOS/.gitignore index 18ac78184..d39e42089 100644 --- a/iOS/.gitignore +++ b/iOS/.gitignore @@ -4,7 +4,6 @@ *.xcscmblueprint *.framework *.xcworkspacedata -xcshareddata *.zip agora_sdk diff --git a/iOS/APIExample-Audio/cloud_build.sh b/iOS/APIExample-Audio/cloud_build.sh index 891825139..d0eb9c347 100755 --- a/iOS/APIExample-Audio/cloud_build.sh +++ b/iOS/APIExample-Audio/cloud_build.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh +export LANG=en_US.UTF-8 +export PATH=$PATH:/opt/homebrew/bin PROJECT_PATH=$PWD diff --git a/iOS/APIExample-Audio/cloud_project.sh b/iOS/APIExample-Audio/cloud_project.sh new file mode 100755 index 000000000..d29b833f7 --- /dev/null +++ b/iOS/APIExample-Audio/cloud_project.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +PROJECT_PATH=$PWD + +if [ "$WORKSPACE" = "" ]; then + WORKSPACE=$PWD +fi +if [ "$BUILD_NUMBER" = "" ]; then + BUILD_NUMBER=888 +fi + + +cd ${PROJECT_PATH} && pod install || exit 1 + diff --git a/iOS/APIExample-OC/cloud_build.sh b/iOS/APIExample-OC/cloud_build.sh index 6f034dcbd..9949106d3 100755 --- a/iOS/APIExample-OC/cloud_build.sh +++ b/iOS/APIExample-OC/cloud_build.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh +export LANG=en_US.UTF-8 +export PATH=$PATH:/opt/homebrew/bin PROJECT_PATH=$PWD diff --git a/iOS/APIExample-OC/cloud_project.sh b/iOS/APIExample-OC/cloud_project.sh new file mode 100755 index 000000000..d29b833f7 --- /dev/null +++ b/iOS/APIExample-OC/cloud_project.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +PROJECT_PATH=$PWD + +if [ "$WORKSPACE" = "" ]; then + WORKSPACE=$PWD +fi +if [ "$BUILD_NUMBER" = "" ]; then + BUILD_NUMBER=888 +fi + + +cd ${PROJECT_PATH} && pod install || exit 1 + diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI.xcodeproj/xcshareddata/xcschemes/APIExample-SwiftUI.xcscheme b/iOS/APIExample-SwiftUI/APIExample-SwiftUI.xcodeproj/xcshareddata/xcschemes/APIExample-SwiftUI.xcscheme new file mode 100644 index 000000000..43d4de21c --- /dev/null +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI.xcodeproj/xcshareddata/xcschemes/APIExample-SwiftUI.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme b/iOS/APIExample-SwiftUI/APIExample-SwiftUI.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme new file mode 100644 index 000000000..f0441d8b9 --- /dev/null +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample-SwiftUI/cloud_build.sh b/iOS/APIExample-SwiftUI/cloud_build.sh index 09e1db451..e1eacbc4e 100755 --- a/iOS/APIExample-SwiftUI/cloud_build.sh +++ b/iOS/APIExample-SwiftUI/cloud_build.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh +export LANG=en_US.UTF-8 +export PATH=$PATH:/opt/homebrew/bin PROJECT_PATH=$PWD diff --git a/iOS/APIExample-SwiftUI/cloud_project.sh b/iOS/APIExample-SwiftUI/cloud_project.sh new file mode 100755 index 000000000..d29b833f7 --- /dev/null +++ b/iOS/APIExample-SwiftUI/cloud_project.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +PROJECT_PATH=$PWD + +if [ "$WORKSPACE" = "" ]; then + WORKSPACE=$PWD +fi +if [ "$BUILD_NUMBER" = "" ]; then + BUILD_NUMBER=888 +fi + + +cd ${PROJECT_PATH} && pod install || exit 1 + diff --git a/iOS/APIExample.xcodeproj/xcshareddata/xcschemes/APIExample.xcscheme b/iOS/APIExample.xcodeproj/xcshareddata/xcschemes/APIExample.xcscheme new file mode 100644 index 000000000..e81351701 --- /dev/null +++ b/iOS/APIExample.xcodeproj/xcshareddata/xcschemes/APIExample.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme b/iOS/APIExample.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme new file mode 100644 index 000000000..dcf57568b --- /dev/null +++ b/iOS/APIExample.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample/APIExample.xcodeproj/xcshareddata/xcschemes/APIExample.xcscheme b/iOS/APIExample/APIExample.xcodeproj/xcshareddata/xcschemes/APIExample.xcscheme new file mode 100644 index 000000000..24009601b --- /dev/null +++ b/iOS/APIExample/APIExample.xcodeproj/xcshareddata/xcschemes/APIExample.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample/APIExample.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme b/iOS/APIExample/APIExample.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme new file mode 100644 index 000000000..c6b492911 --- /dev/null +++ b/iOS/APIExample/APIExample.xcodeproj/xcshareddata/xcschemes/Agora-ScreenShare-Extension.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOS/APIExample/cloud_build.sh b/iOS/APIExample/cloud_build.sh index 876662738..7c14474a9 100755 --- a/iOS/APIExample/cloud_build.sh +++ b/iOS/APIExample/cloud_build.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh +export LANG=en_US.UTF-8 +export PATH=$PATH:/opt/homebrew/bin PROJECT_PATH=$PWD diff --git a/iOS/APIExample/cloud_project.sh b/iOS/APIExample/cloud_project.sh new file mode 100755 index 000000000..52c7e703e --- /dev/null +++ b/iOS/APIExample/cloud_project.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env sh + +PROJECT_PATH=$PWD + +if [ "$WORKSPACE" = "" ]; then + WORKSPACE=$PWD +fi +if [ "$BUILD_NUMBER" = "" ]; then + BUILD_NUMBER=888 +fi + +#下载美颜资源 +echo "start download bytedance resource : $bytedance_lib" +curl -L -O "$bytedance_lib" +unzip -o vender_bytedance_iOS.zip +rm -f vender_bytedance_iOS.zip + +echo "start download sense resource : $sense_lib" +curl -L -O "$sense_lib" +unzip -o vender_sense_iOS.zip +rm -f vender_sense_iOS.zip + +echo "start download fu resource : $fu_lib" +curl -L -O "$fu_lib" +unzip -o vender_fu_iOS.zip +rm -f vender_fu_iOS.zip + +#打开第三方播放器配置 +perl -i -pe "s#\# pod 'ijkplayer'# pod 'ijkplayer'#g" Podfile + +#打开第三方美颜 +perl -i -pe "s#\#pod 'SenseLib'#pod 'SenseLib'#g" Podfile +perl -i -pe "s#\#pod 'bytedEffect'#pod 'bytedEffect'#g" Podfile +perl -i -pe "s#\#pod 'fuLib'#pod 'fuLib'#g" Podfile + +pod install --repo-update || exit 1 + diff --git a/macOS/ExportOptions.plist b/macOS/ExportOptions.plist index cbad22e1e..d85797e0a 100644 --- a/macOS/ExportOptions.plist +++ b/macOS/ExportOptions.plist @@ -5,17 +5,17 @@ destination export method - developer-id + developer provisioningProfiles io.agora.api.examples - apiexamplemac + AgoraLab2020 signingCertificate - 35CC30DFC3AA90845718DE3E28DFD32DB1A672BF + Apple Development signingStyle manual teamID - YS397FG5PA + JDPG69R49Z diff --git a/macOS/cloud_build.sh b/macOS/cloud_build.sh index c2dc367b3..ecf482327 100755 --- a/macOS/cloud_build.sh +++ b/macOS/cloud_build.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh +export LANG=en_US.UTF-8 +export PATH=$PATH:/opt/homebrew/bin PROJECT_PATH=$PWD @@ -30,13 +32,23 @@ PBXPROJ_PATH=${TARGET_NAME}.xcodeproj/project.pbxproj # Debug /usr/libexec/PlistBuddy -c "Set :objects:03896D5324F8A011008593CD:buildSettings:CODE_SIGN_STYLE 'Manual'" $PBXPROJ_PATH /usr/libexec/PlistBuddy -c "Set :objects:03896D5324F8A011008593CD:buildSettings:CODE_SIGN_IDENTITY 'Developer ID Application'" $PBXPROJ_PATH -/usr/libexec/PlistBuddy -c "Set :objects:03896D5324F8A011008593CD:buildSettings:DEVELOPMENT_TEAM 'YS397FG5PA'" $PBXPROJ_PATH -/usr/libexec/PlistBuddy -c "Set :objects:03896D5324F8A011008593CD:buildSettings:PROVISIONING_PROFILE_SPECIFIER 'apiexamplemac'" $PBXPROJ_PATH +/usr/libexec/PlistBuddy -c "Set :objects:03896D5324F8A011008593CD:buildSettings:DEVELOPMENT_TEAM 'GM72UGLGZW'" $PBXPROJ_PATH +/usr/libexec/PlistBuddy -c "Set :objects:03896D5324F8A011008593CD:buildSettings:PROVISIONING_PROFILE_SPECIFIER 'App'" $PBXPROJ_PATH # Release /usr/libexec/PlistBuddy -c "Set :objects:03896D5424F8A011008593CD:buildSettings:CODE_SIGN_STYLE 'Manual'" $PBXPROJ_PATH /usr/libexec/PlistBuddy -c "Set :objects:03896D5424F8A011008593CD:buildSettings:CODE_SIGN_IDENTITY 'Developer ID Application'" $PBXPROJ_PATH -/usr/libexec/PlistBuddy -c "Set :objects:03896D5424F8A011008593CD:buildSettings:DEVELOPMENT_TEAM 'YS397FG5PA'" $PBXPROJ_PATH -/usr/libexec/PlistBuddy -c "Set :objects:03896D5424F8A011008593CD:buildSettings:PROVISIONING_PROFILE_SPECIFIER 'apiexamplemac'" $PBXPROJ_PATH +/usr/libexec/PlistBuddy -c "Set :objects:03896D5424F8A011008593CD:buildSettings:DEVELOPMENT_TEAM 'GM72UGLGZW'" $PBXPROJ_PATH +/usr/libexec/PlistBuddy -c "Set :objects:03896D5424F8A011008593CD:buildSettings:PROVISIONING_PROFILE_SPECIFIER 'App'" $PBXPROJ_PATH + +# SimpleFilter +# Debug +/usr/libexec/PlistBuddy -c "Set :objects:8BD4AE7E272518D600E95B87:buildSettings:CODE_SIGN_STYLE 'Manual'" $PBXPROJ_PATH +/usr/libexec/PlistBuddy -c "Set :objects:8BD4AE7E272518D600E95B87:buildSettings:DEVELOPMENT_TEAM ''" $PBXPROJ_PATH +/usr/libexec/PlistBuddy -c "Set :objects:8BD4AE7E272518D600E95B87:buildSettings:PROVISIONING_PROFILE_SPECIFIER ''" $PBXPROJ_PATH +# Release +/usr/libexec/PlistBuddy -c "Set :objects:8BD4AE7F272518D600E95B87:buildSettings:CODE_SIGN_STYLE 'Manual'" $PBXPROJ_PATH +/usr/libexec/PlistBuddy -c "Set :objects:8BD4AE7F272518D600E95B87:buildSettings:DEVELOPMENT_TEAM ''" $PBXPROJ_PATH +/usr/libexec/PlistBuddy -c "Set :objects:8BD4AE7F272518D600E95B87:buildSettings:PROVISIONING_PROFILE_SPECIFIER ''" $PBXPROJ_PATH #修改build number # Debug @@ -71,6 +83,7 @@ ARCHIVE_PATH="${WORKSPACE}/${TARGET_NAME}_${BUILD_NUMBER}.xcarchive" # plist路径 PLIST_PATH="${PROJECT_PATH}/ExportOptions.plist" +echo PLIST_PATH: $PLIST_PATH # archive 这边使用的工作区间 也可以使用project xcodebuild archive -workspace "${APP_PATH}" -scheme "${TARGET_NAME}" -configuration "${CONFIGURATION}" -archivePath "${ARCHIVE_PATH}" @@ -80,6 +93,8 @@ cd ${WORKSPACE} # 压缩archive 7za a -tzip "${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" "${ARCHIVE_PATH}" +echo "start sign..." + # 签名 sh sign "${WORKSPACE}/${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" --type xcarchive --plist "${PLIST_PATH}" --application macApp diff --git a/macOS/cloud_project.sh b/macOS/cloud_project.sh new file mode 100755 index 000000000..d29b833f7 --- /dev/null +++ b/macOS/cloud_project.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +PROJECT_PATH=$PWD + +if [ "$WORKSPACE" = "" ]; then + WORKSPACE=$PWD +fi +if [ "$BUILD_NUMBER" = "" ]; then + BUILD_NUMBER=888 +fi + + +cd ${PROJECT_PATH} && pod install || exit 1 +