Skip to content

Commit c36d444

Browse files
authored
Dev/4.5.2 nci update (#554)
* feat: update ci (#541) * feat: update ci * Update url_config.txt * Update build_mac.sh (#542) * Dev/4.5.2 nci (#553) * Update build_mac.sh * add job dep * Update terra.yml * Update dep.sh * Update dep.sh * fix: no native sdk * Update dep.sh * Update dep.sh * feat: update dep.sh * feat: update dep.sh to remove version input * feat: update dep.sh to remove version input * feat: update dep.sh to remove version input * feat: update dep.sh to remove version input * feat: update dep.sh to remove version input * feat: update dep.sh to remove version input * feat: update dep.sh to remove version input * feat: update dep.sh to remove version input * feat: add build number * ci: update dep * ci: add final product url tag
1 parent b7f27e8 commit c36d444

File tree

5 files changed

+571
-25
lines changed

5 files changed

+571
-25
lines changed

.github/workflows/terra.yml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Generate codes and create pull request
33
on:
44
workflow_dispatch:
55
inputs:
6-
rtc_version:
7-
description: 'verison (rtc_4.3.2, rtm_2.2.4 like)'
6+
dependencies-content:
7+
description: The content of dependencies
88
required: true
99
type: string
1010

@@ -21,8 +21,37 @@ jobs:
2121
- name: Setup
2222
uses: ./.github/setup
2323

24+
- name: Get dependencies
25+
id: dep
26+
uses: AgoraIO-Extensions/actions/.github/actions/dep@main
27+
with:
28+
dependencies-content: ${{ inputs.dependencies-content }}
29+
30+
- name: Update dependencies
31+
run: |
32+
sh ci/build/dep.sh ${{ steps.dep.outputs.matches }}
33+
34+
- name: Extract version info
35+
id: version
36+
run: |
37+
# Extract product_type and version from JSON
38+
# Remove outer quotes and unescape JSON
39+
JSON_RAW='${{ steps.dep.outputs.matches }}'
40+
JSON_OUTPUT=$(printf '%s' "$JSON_RAW" | sed 's/^"//;s/"$//' | sed 's/\\"/"/g')
41+
PRODUCT_TYPE=$(echo "$JSON_OUTPUT" | jq -r '.[] | select(.version != "" and .version != null) | .product_type' | head -n 1)
42+
VERSION=$(echo "$JSON_OUTPUT" | jq -r '.[] | select(.version != "" and .version != null) | .version' | head -n 1)
43+
FULL_VERSION="${PRODUCT_TYPE}_${VERSION}"
44+
echo "product_type=$PRODUCT_TYPE" >> $GITHUB_OUTPUT
45+
echo "version=$VERSION" >> $GITHUB_OUTPUT
46+
echo "full_version=$FULL_VERSION" >> $GITHUB_OUTPUT
47+
echo "Extracted: $FULL_VERSION"
48+
2449
- name: Replace rtc version
25-
run: sh terra/replace_rtc_version.sh ${{ inputs.rtc_version }}
50+
run: |
51+
# Remove outer quotes and unescape JSON
52+
JSON_RAW='${{ steps.dep.outputs.matches }}'
53+
JSON_OUTPUT=$(printf '%s' "$JSON_RAW" | sed 's/^"//;s/"$//' | sed 's/\\"/"/g')
54+
sh terra/replace_rtc_version.sh "$JSON_OUTPUT"
2655
2756
- name: Generate code and comment by terra
2857
uses: AgoraIO-Extensions/actions/.github/actions/generate@main
@@ -41,9 +70,9 @@ jobs:
4170
github-token: ${{ secrets.GH_TOKEN }}
4271
target-repo: ${{ github.workspace }}
4372
target-branch: ${{ github.ref_name }}
44-
target-branch-name-surffix: terra-update/${{ inputs.rtc_version }}
73+
target-branch-name-surffix: terra-update/${{ steps.version.outputs.full_version }}
4574
pull-request-title: |
46-
[AUTO] Generate codes by terra(${{ inputs.rtc_version }})
75+
[AUTO] Generate codes by terra(${{ steps.version.outputs.full_version }})
4776
add-paths: .
4877

4978
- name: Check csharp codes compile

ci/build/build_mac.sh

Lines changed: 130 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,129 @@
7171

7272
set -ex
7373

74+
###############################################
75+
# Resolve IRIS platform URLs from env or file #
76+
###############################################
77+
# If external inputs (env vars) are provided, use them.
78+
# Otherwise, read from ./ci/build/url_config.txt similar to CI/download_plugin.sh.
79+
80+
# Normalize a URL value: trim spaces/CR and map domain
81+
normalize_url() {
82+
local v="$1"
83+
# strip Windows CR and surrounding whitespace
84+
v=$(echo "$v" | tr -d '\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
85+
# map artifactory domain
86+
v=$(echo "$v" | sed 's/https:\/\/artifactory\./https:\/\/artifactory-api.bj2\./')
87+
echo "$v"
88+
}
89+
90+
# Map TYPE to SDK_TYPE used in url_config.txt sections
91+
if [ "$TYPE" == "VOICE" ]; then
92+
SDK_TYPE="audio"
93+
else
94+
SDK_TYPE="video"
95+
fi
96+
97+
CONFIG_FILE="./ci/build/url_config.txt"
98+
99+
###############################################
100+
# Read and increment Build number from config #
101+
###############################################
102+
BUILD_VERSION=0
103+
if [ -f "$CONFIG_FILE" ]; then
104+
FLAG=0
105+
while IFS= read -r line; do
106+
# enter/exit SDK_TYPE section (audio or video)
107+
if [[ $line == *">>>$SDK_TYPE"* ]]; then
108+
FLAG=1
109+
fi
110+
if [[ $line == *"<<<end"* ]] && [[ $FLAG == 1 ]]; then
111+
FLAG=0
112+
fi
113+
114+
if [[ $FLAG == 1 ]] && [[ $line == *"Build="* ]]; then
115+
# Extract build number
116+
BUILD_VERSION=$(echo "$line" | sed 's/Build[[:space:]]*=//' | tr -d '\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
117+
# Increment build number
118+
BUILD_VERSION=$((BUILD_VERSION + 1))
119+
# Update config file with new build number in the specific section
120+
sed -i '' "/>>>$SDK_TYPE/,/<<<end/ s/Build=.*/Build=$BUILD_VERSION/" "$CONFIG_FILE"
121+
break
122+
fi
123+
done < "$CONFIG_FILE"
124+
fi
125+
126+
echo "Build Version for $SDK_TYPE: $BUILD_VERSION"
127+
128+
if [ -z "$IRIS_IOS_URL" ] || [ -z "$IRIS_ANDROID_URL" ] || [ -z "$IRIS_MAC_URL" ] || [ -z "$IRIS_WIN_URL" ] || \
129+
[ -z "$NATIVE_IOS_URL" ] || [ -z "$NATIVE_ANDROID_URL" ] || [ -z "$NATIVE_MAC_URL" ] || [ -z "$NATIVE_WIN_URL" ]; then
130+
if [ -f "$CONFIG_FILE" ]; then
131+
FLAG=0
132+
while IFS= read -r line; do
133+
# enter/exit target section
134+
if [[ $line == *">>>$SDK_TYPE"* ]]; then
135+
FLAG=1
136+
fi
137+
if [[ $line == *"<<<end"* ]]; then
138+
FLAG=0
139+
fi
140+
141+
if [[ $FLAG == 1 ]]; then
142+
case $line in
143+
*"IRIS_IOS"*)
144+
if [ -z "$IRIS_IOS_URL" ]; then
145+
tmp=$(echo "$line" | sed 's/IRIS_IOS[[:space:]]*=//')
146+
IRIS_IOS_URL=$(normalize_url "$tmp")
147+
fi
148+
;;
149+
*"IRIS_ANDROID"*)
150+
if [ -z "$IRIS_ANDROID_URL" ]; then
151+
tmp=$(echo "$line" | sed 's/IRIS_ANDROID[[:space:]]*=//')
152+
IRIS_ANDROID_URL=$(normalize_url "$tmp")
153+
fi
154+
;;
155+
*"IRIS_MAC"*)
156+
if [ -z "$IRIS_MAC_URL" ]; then
157+
tmp=$(echo "$line" | sed 's/IRIS_MAC[[:space:]]*=//')
158+
IRIS_MAC_URL=$(normalize_url "$tmp")
159+
fi
160+
;;
161+
*"IRIS_WIN"*)
162+
if [ -z "$IRIS_WIN_URL" ]; then
163+
tmp=$(echo "$line" | sed 's/IRIS_WIN[[:space:]]*=//')
164+
IRIS_WIN_URL=$(normalize_url "$tmp")
165+
fi
166+
;;
167+
*"NATIVE_IOS"*)
168+
if [ -z "$NATIVE_IOS_URL" ]; then
169+
tmp=$(echo "$line" | sed 's/NATIVE_IOS[[:space:]]*=//')
170+
NATIVE_IOS_URL=$(normalize_url "$tmp")
171+
fi
172+
;;
173+
*"NATIVE_ANDROID"*)
174+
if [ -z "$NATIVE_ANDROID_URL" ]; then
175+
tmp=$(echo "$line" | sed 's/NATIVE_ANDROID[[:space:]]*=//')
176+
NATIVE_ANDROID_URL=$(normalize_url "$tmp")
177+
fi
178+
;;
179+
*"NATIVE_MAC"*)
180+
if [ -z "$NATIVE_MAC_URL" ]; then
181+
tmp=$(echo "$line" | sed 's/NATIVE_MAC[[:space:]]*=//')
182+
NATIVE_MAC_URL=$(normalize_url "$tmp")
183+
fi
184+
;;
185+
*"NATIVE_WIN"*)
186+
if [ -z "$NATIVE_WIN_URL" ]; then
187+
tmp=$(echo "$line" | sed 's/NATIVE_WIN[[:space:]]*=//')
188+
NATIVE_WIN_URL=$(normalize_url "$tmp")
189+
fi
190+
;;
191+
esac
192+
fi
193+
done < "$CONFIG_FILE"
194+
fi
195+
fi
196+
74197
echo Package_Publish: $Package_Publish
75198
echo is_tag_fetch: $is_tag_fetch
76199
echo arch: $arch
@@ -534,9 +657,9 @@ if [ "$VISIONOS_URL" != "" -a "$SPLIT_VISIONOS" == "true" ]; then
534657
$UNITY_DIR/Unity -quit -batchmode -nographics -openProjects "./project" -exportPackage "Assets/$PLUGIN_NAME/$PLUGIN_CODE_NAME/Plugins/visionOS" "$PLUGIN_NAME-VisionOS.unitypackage" || exit 1
535658
ZIP_FILE="Unknow"
536659
if [ "$RTC" == "true" ]; then
537-
ZIP_FILE=Agora_Unity_RTC_VisionOS_SDK_${SDK_VERSION}_${TYPE}_${build_date}_${BUILD_NUMBER}_${SUFFIX}.zip
660+
ZIP_FILE=Agora_Unity_RTC_VisionOS_SDK_${SDK_VERSION}_${TYPE}_${build_date}_${BUILD_NUMBER}_build${BUILD_VERSION}_${SUFFIX}.zip
538661
else
539-
ZIP_FILE=Agora_Unity_RTM_VisionOS_SDK_${SDK_VERSION}_${build_date}_${BUILD_NUMBER}_${SUFFIX}.zip
662+
ZIP_FILE=Agora_Unity_RTM_VisionOS_SDK_${SDK_VERSION}_${build_date}_${BUILD_NUMBER}_build${BUILD_VERSION}_${SUFFIX}.zip
540663
fi
541664
7za a ./${ZIP_FILE} ./project/"$PLUGIN_NAME-VisionOS.unitypackage"
542665

@@ -559,13 +682,16 @@ fi
559682
$UNITY_DIR/Unity -quit -batchmode -nographics -openProjects "./project" -exportPackage "Assets" "$PLUGIN_NAME.unitypackage" || exit 1
560683
ZIP_FILE="Unknow"
561684
if [ "$RTC" == "true" ]; then
562-
ZIP_FILE="$BRAND"_Unity_RTC_SDK_${SDK_VERSION}_${TYPE}_${build_date}_${BUILD_NUMBER}_${SUFFIX}.zip
685+
ZIP_FILE="$BRAND"_Unity_RTC_SDK_${SDK_VERSION}_${TYPE}_${build_date}_${BUILD_NUMBER}_build${BUILD_VERSION}_${SUFFIX}.zip
563686
else
564-
ZIP_FILE="$BRAND"_Unity_RTM_SDK_${SDK_VERSION}_${build_date}_${BUILD_NUMBER}_${SUFFIX}.zip
687+
ZIP_FILE="$BRAND"_Unity_RTM_SDK_${SDK_VERSION}_${build_date}_${BUILD_NUMBER}_build${BUILD_VERSION}_${SUFFIX}.zip
565688
fi
566689
7za a ./${ZIP_FILE} ./project/"$PLUGIN_NAME.unitypackage"
567690

568691
download_file=$(python3 ${WORKSPACE}/artifactory_utils.py --action=upload_file --file=./$ZIP_FILE --project)
692+
echo "NOTIFICATION_TEXT START"
693+
echo "$download_file"
694+
echo "NOTIFICATION_TEXT END"
569695
payload1='{
570696
"msgtype": "text",
571697
"text": {

0 commit comments

Comments
 (0)