Skip to content

Commit f37314c

Browse files
authored
Merge pull request #452 from AgoraIO/dev/example-ci
Dev/example ci
2 parents a4428fb + 3831607 commit f37314c

File tree

22 files changed

+716
-15
lines changed

22 files changed

+716
-15
lines changed

.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: 37 additions & 0 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,6 +63,12 @@ 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
66+
apiexample_cn_name=Shengwang_Native_SDK_for_iOS
67+
apiexample_global_name=Agora_Native_SDK_for_iOS
68+
cn_dir=CN
69+
global_dir=Global
70+
71+
6472
if [ -z "$sdk_url" ]; then
6573
sdk_url_flag=false
6674
echo "sdk_url is empty"
@@ -99,6 +107,35 @@ echo "start move to"
99107
echo $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name
100108
mv result.zip $WORKSPACE/with${ios_direction}_${BUILD_NUMBER}_$zip_name
101109

110+
if [ $compress_apiexample = true ]; then
111+
sdk_version=$(grep "pod 'AgoraRtcEngine_iOS'" ./iOS/${ios_direction}/Podfile | sed -n "s/.*'\([0-9.]*\)'.*/\1/p")
112+
echo "sdk_version: $sdk_version"
113+
114+
mkdir -p $cn_dir $global_dir
115+
cp -rf ./iOS/${ios_direction} $cn_dir/
116+
cp -rf ./iOS/${ios_direction} $global_dir/
117+
cd $cn_dir/${ios_direction}
118+
./cloud_project.sh || exit 1
119+
cd -
120+
echo "start compress api example"
121+
7za a -tzip cn_result.zip $cn_dir
122+
7za a -tzip global_result.zip $global_dir
123+
echo "complete compress api example"
124+
echo "current path: `pwd`"
125+
ls -al
126+
cn_des_path=$WORKSPACE/${apiexample_cn_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip
127+
global_des_path=$WORKSPACE/${apiexample_global_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip
128+
echo "cn_des_path: $cn_des_path"
129+
echo "Moving cn_result.zip to $cn_des_path"
130+
mv cn_result.zip $cn_des_path
131+
132+
echo "global_des_path: $global_des_path"
133+
echo "Moving global_result.zip to $global_des_path"
134+
mv global_result.zip $global_des_path
135+
136+
ls -al $WORKSPACE/
137+
fi
138+
102139
if [ $compile_project = true ]; then
103140
cd ./$unzip_name/samples/${ios_direction}
104141
./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: 29 additions & 4 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
@@ -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

iOS/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*.xcscmblueprint
55
*.framework
66
*.xcworkspacedata
7-
xcshareddata
87

98
*.zip
109
agora_sdk

iOS/APIExample-Audio/cloud_build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env sh
2+
export LANG=en_US.UTF-8
3+
export PATH=$PATH:/opt/homebrew/bin
24

35
PROJECT_PATH=$PWD
46

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env sh
2+
3+
PROJECT_PATH=$PWD
4+
5+
if [ "$WORKSPACE" = "" ]; then
6+
WORKSPACE=$PWD
7+
fi
8+
if [ "$BUILD_NUMBER" = "" ]; then
9+
BUILD_NUMBER=888
10+
fi
11+
12+
13+
cd ${PROJECT_PATH} && pod install || exit 1
14+

iOS/APIExample-OC/cloud_build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env sh
2+
export LANG=en_US.UTF-8
3+
export PATH=$PATH:/opt/homebrew/bin
24

35
PROJECT_PATH=$PWD
46

iOS/APIExample-OC/cloud_project.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env sh
2+
3+
PROJECT_PATH=$PWD
4+
5+
if [ "$WORKSPACE" = "" ]; then
6+
WORKSPACE=$PWD
7+
fi
8+
if [ "$BUILD_NUMBER" = "" ]; then
9+
BUILD_NUMBER=888
10+
fi
11+
12+
13+
cd ${PROJECT_PATH} && pod install || exit 1
14+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1540"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "4C9306882CB9607E0085EFF9"
19+
BuildableName = "APIExample-SwiftUI.app"
20+
BlueprintName = "APIExample-SwiftUI"
21+
ReferencedContainer = "container:APIExample-SwiftUI.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
shouldAutocreateTestPlan = "YES">
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "4C9306882CB9607E0085EFF9"
48+
BuildableName = "APIExample-SwiftUI.app"
49+
BlueprintName = "APIExample-SwiftUI"
50+
ReferencedContainer = "container:APIExample-SwiftUI.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "4C9306882CB9607E0085EFF9"
65+
BuildableName = "APIExample-SwiftUI.app"
66+
BlueprintName = "APIExample-SwiftUI"
67+
ReferencedContainer = "container:APIExample-SwiftUI.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>

0 commit comments

Comments
 (0)