Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8b470c5
[FIX] windows ci
Jan 19, 2026
d4747e7
chore: improve git hooks
Feb 3, 2026
b6ea09a
chore: upgrade Android projects to API 35
Feb 3, 2026
1d24196
Merge branch 'main' into dev/adapter_android35
Feb 3, 2026
22e409a
[FIX] ci: Windows CI cloud build and dependency installation with fixes
Feb 4, 2026
f8125c4
Merge branch 'main' into dev/4.6.2-win-ci
Feb 4, 2026
0f0e373
[FIX] optimize ci stemp
Feb 4, 2026
0eca1ab
[FEAT] create tag yml
Feb 4, 2026
2f8c423
Modify file name of output
Feb 5, 2026
3cea53f
[FEAT] windows ci update
Feb 5, 2026
ee9d31e
Merge branch 'dev/4.5.3' of github.com:Shengwang-Community/API-Exampl…
Feb 5, 2026
4196627
Fix ci issues
Feb 5, 2026
39a6fea
Merge branch 'dev/4.5.3' of https://github.com/Shengwang-Community/AP…
Feb 5, 2026
63f1db2
Test version doesn't match
Feb 5, 2026
355eccd
feat(ci): add version validation and update Android build naming
Feb 5, 2026
cef4623
Add log
Feb 5, 2026
22fffe1
Merge branch 'dev/4.5.3' of https://github.com/Shengwang-Community/AP…
Feb 5, 2026
5e37e66
feat(ci): add version validation and BUILD_NUMBER to Android build
Feb 5, 2026
b15aab3
Test ci
Feb 5, 2026
e412a3e
Merge branch 'dev/4.5.3' of https://github.com/Shengwang-Community/AP…
Feb 5, 2026
2a3e31b
Bugfix
Feb 5, 2026
171e327
Fix fetch version script
Feb 5, 2026
b643dcd
[FEAT] update windows and mac ci
Feb 5, 2026
0f03588
Merge branch 'dev/adapter_android35' into dev/4.5.3
Feb 5, 2026
dcfa72c
feat(android): update rootProject.name
Feb 5, 2026
98fa9d8
Synchronize scripts to other platforms
Feb 5, 2026
988f486
Merge branch 'dev/4.5.3' of https://github.com/Shengwang-Community/AP…
Feb 5, 2026
a792840
Modify version number
Feb 5, 2026
23f6f83
Bugfix
Feb 5, 2026
eeb333f
feat(ci): standardize Android CI with version validation and unified …
Feb 5, 2026
0c18f4e
[FEAT] windows sdk version 4.5.3
Feb 5, 2026
9f49ee1
Merge branch 'dev/4.5.3' of github.com:Shengwang-Community/API-Exampl…
Feb 5, 2026
8ac12c5
bugfix
Feb 5, 2026
4ed17bc
Merge branch 'dev/4.5.3' of https://github.com/Shengwang-Community/AP…
Feb 5, 2026
9940e57
feat(android): 4.6.3
Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .git-hooks/install-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ else
print_green "pre-commit is already installed!"
fi

# Check if gitleaks is installed
# Check if gitleaks is installed (required)
if ! command -v gitleaks &> /dev/null; then
print_yellow "gitleaks not found, please install it..."
print_red "❌ gitleaks not found - this is a required security tool!"
print_yellow "Installation guide: https://github.com/gitleaks/gitleaks#installing"

# Attempt automatic installation (based on OS)
Expand All @@ -77,6 +77,8 @@ if ! command -v gitleaks &> /dev/null; then
print_red "Please install gitleaks manually and try again"
exit 1
fi
else
print_green "gitleaks is installed!"
fi

# Check required files and directories
Expand Down
14 changes: 5 additions & 9 deletions .git-hooks/post-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@
# Check if required hooks are installed
if [ ! -f ".git/hooks/commit-msg" ] || [ ! -x ".git/hooks/commit-msg" ]; then
echo "============================================================"
echo "Note: Git hooks for checking Chinese characters in commit messages are not installed."
echo "⚠️ Note: Git hooks for checking commit messages are not installed."
echo "Please run the following commands to install:"
echo ""
echo " 1. Install pre-commit:"
echo " pip install pre-commit"
echo ""
echo " 2. Install pre-commit hook:"
echo " pre-commit install"
echo " 2. Install hooks:"
echo " .git-hooks/install-hooks.sh"
echo ""
echo " 3. Install commit-msg hook:"
echo " pre-commit install --hook-type commit-msg"
echo " cp .git-hooks/check-commit-message.sh .git/hooks/commit-msg"
echo " chmod +x .git/hooks/commit-msg"
echo ""
echo "These hooks will help detect sensitive information leaks and Chinese characters in commit messages."
echo "These hooks will help detect sensitive information leaks and"
echo "Chinese characters in commit messages."
echo "============================================================"
fi

Expand Down
13 changes: 9 additions & 4 deletions .git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
# Check if gitleaks is configured
if ! command -v gitleaks &> /dev/null; then
echo "============================================================"
echo "Gitleaks not detected. This is a required tool to prevent sensitive information leaks."
echo "Please install gitleaks first: https://github.com/gitleaks/gitleaks#installing"
echo "❌ ERROR: Gitleaks not detected."
echo "This is a required tool to prevent sensitive information leaks."
echo ""
echo "Please install gitleaks first:"
echo " macOS: brew install gitleaks"
echo " Other: https://github.com/gitleaks/gitleaks#installing"
echo ""
echo "After installation, run: ./.git-hooks/install-hooks.sh"
echo "============================================================"
exit 1
Expand All @@ -14,12 +19,12 @@ fi
if [ -f ".gitleaks.toml" ]; then
gitleaks detect --source . --config .gitleaks.toml
if [ $? -ne 0 ]; then
echo "Gitleaks detected sensitive information. Commit rejected."
echo "Gitleaks detected sensitive information. Commit rejected."
echo "Please review the output above and remove sensitive information."
exit 1
fi
else
echo "No .gitleaks.toml configuration file found, skipping sensitive information check."
echo "⚠️ No .gitleaks.toml configuration file found, skipping sensitive information check."
fi

exit 0
35 changes: 35 additions & 0 deletions .git-hooks/run-gitleaks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Try to find gitleaks in common locations
GITLEAKS_CMD=""

# Check if gitleaks is in PATH
if command -v gitleaks &> /dev/null; then
GITLEAKS_CMD="gitleaks"
# Check Homebrew locations (Intel Mac)
elif [ -f "/usr/local/bin/gitleaks" ]; then
GITLEAKS_CMD="/usr/local/bin/gitleaks"
# Check Homebrew locations (Apple Silicon Mac)
elif [ -f "/opt/homebrew/bin/gitleaks" ]; then
GITLEAKS_CMD="/opt/homebrew/bin/gitleaks"
# Check if installed via other package managers
elif [ -f "$HOME/.local/bin/gitleaks" ]; then
GITLEAKS_CMD="$HOME/.local/bin/gitleaks"
fi

# If gitleaks not found, exit with error
if [ -z "$GITLEAKS_CMD" ]; then
echo "============================================================"
echo "❌ ERROR: gitleaks not found!"
echo ""
echo "Please install gitleaks:"
echo " macOS: brew install gitleaks"
echo " Linux: https://github.com/gitleaks/gitleaks#installing"
echo ""
echo "After installation, run: ./.git-hooks/install-hooks.sh"
echo "============================================================"
exit 1
fi

# Run gitleaks with provided arguments
exec "$GITLEAKS_CMD" "$@"
163 changes: 153 additions & 10 deletions .github/ci/build/build_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
##################################
export PATH=$PATH:/opt/homebrew/bin

# Record build start time
START_TIME=$(date +%s)
echo "=========================================="
echo "Build started at: $(date '+%Y-%m-%d %H:%M:%S')"
echo "=========================================="
echo ""

echo Package_Publish: $Package_Publish
echo is_tag_fetch: $is_tag_fetch
echo arch: $arch
Expand All @@ -48,23 +55,108 @@ echo build_date: $build_date
echo build_time: $build_time
echo release_version: $release_version
echo short_version: $short_version
echo BUILD_NUMBER: $BUILD_NUMBER
echo pwd: `pwd`
echo sdk_url: $sdk_url
echo android_direction: $android_direction
echo compile_project: $compile_project
echo compress_apiexample: $compress_apiexample
echo api_examples_shengwang_branch: $api_examples_shengwang_branch

# Validate required variables
if [ -z "$android_direction" ]; then
echo "Error: android_direction variable is not set"
exit 1
fi

# ===== Version Consistency Check =====
echo ""
echo "=========================================="
echo "Checking version consistency..."
echo "=========================================="

# Extract version number from branch name (supports formats like dev/4.6.2, release/4.6.2, etc.)
BRANCH_VERSION=$(echo $api_examples_shengwang_branch | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n 1)

if [ -z "$BRANCH_VERSION" ]; then
echo ""
echo "=========================================="
echo "❌ CI BUILD FAILED: CANNOT EXTRACT VERSION"
echo "=========================================="
echo "Cannot extract version from branch name: $api_examples_shengwang_branch"
echo "Branch name must contain version number (e.g., dev/4.6.2, release/4.6.2)"
echo "=========================================="
exit 1
fi

echo "Branch version: $BRANCH_VERSION"
echo ""

# Check all gradle.properties files
GRADLE_FILES=(
"Android/APIExample/gradle.properties"
"Android/APIExample-Audio/gradle.properties"
"Android/APIExample-Compose/gradle.properties"
)

VERSION_MISMATCH=false

unzip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT
zip_name=Agora_Native_SDK_for_Android_FULL_DEFAULT.zip
for gradle_file in "${GRADLE_FILES[@]}"; do
if [ -f "$gradle_file" ]; then
GRADLE_VERSION=$(grep "rtc_sdk_version" "$gradle_file" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
echo "Checking $gradle_file: $GRADLE_VERSION"

if [ "$GRADLE_VERSION" != "$BRANCH_VERSION" ]; then
echo "❌ ERROR: Version mismatch in $gradle_file"
echo " Branch version: $BRANCH_VERSION"
echo " Gradle version: $GRADLE_VERSION"
VERSION_MISMATCH=true
else
echo "✅ Version matched: $GRADLE_VERSION"
fi
else
echo "⚠️ Warning: $gradle_file not found"
fi
echo ""
done

if [ "$VERSION_MISMATCH" = true ]; then
echo ""
echo "=========================================="
echo "❌ CI BUILD FAILED: VERSION MISMATCH"
echo "=========================================="
echo "Branch name contains version: $BRANCH_VERSION"
echo "But gradle.properties has different version(s)"
echo ""
echo "Please update rtc_sdk_version in all gradle.properties files to: $BRANCH_VERSION"
echo "=========================================="
exit 1
fi

echo "✅ All version checks passed!"
echo "=========================================="
echo ""

unzip_name=Shengwang_Native_SDK_for_Android_FULL_DEFAULT
zip_name=Shengwang_Native_SDK_for_Android_FULL_DEFAULT.zip
if [ -z "$sdk_url" ] || [ "$sdk_url" = "none" ]; then
echo "sdk_url is empty"
echo "sdk_url is empty, using default SDK structure"
echo unzip_name: $unzip_name
echo zip_name: $zip_name
else
zip_name=${sdk_url##*/}
echo zip_name: $zip_name

# Download SDK
echo "Downloading SDK from: $sdk_url"
# env LC_ALL=en_US.UTF-8 python3 $WORKSPACE/artifactory_utils.py --action=download_file --file=$sdk_url || exit 1
curl -o $zip_name $sdk_url || exit 1
echo "✅ SDK downloaded successfully"

# Extract SDK
echo "Extracting SDK package..."
7za x ./$zip_name -y > log.txt
echo "✅ SDK extracted successfully"

# Support top-level directory name containing 'Agora' or 'Shengwang'
unzip_name=`ls -S -d */ | grep -E 'Agora|Shengwang' | head -n 1 | sed 's/\///g'`
Expand All @@ -74,38 +166,89 @@ else
fi
echo unzip_name: $unzip_name

# Clean up unnecessary files
echo "Cleaning up unnecessary files..."
rm -rf ./$unzip_name/rtc/bin
rm -rf ./$unzip_name/rtc/demo
rm -f ./$unzip_name/.commits
rm -f ./$unzip_name/spec
rm -rf ./$unzip_name/pom
echo "✅ Cleanup completed"
fi

mkdir -p ./$unzip_name/rtc/samples/${android_direction} || exit 1
rm -rf ./$unzip_name/rtc/samples/${android_direction}/*

echo ""
echo "Copying API Example code from ./Android/${android_direction}..."
if [ -d "./Android/${android_direction}" ]; then
cp -rf ./Android/${android_direction}/* ./$unzip_name/rtc/samples/${android_direction}/ || exit 1
echo "✅ API Example code copied successfully"
else
echo "Error: Source directory ./Android/${android_direction} does not exist"
exit 1
fi
echo ""

7za a -tzip result.zip -r $unzip_name > log.txt
mv result.zip $WORKSPACE/withAPIExample_${BUILD_NUMBER}_$zip_name

if [ $compress_apiexample = true ]; then
onlyCodeZipName=${android_direction}_onlyCode.zip
7za a -tzip $onlyCodeZipName -r ./$unzip_name/rtc/samples/${android_direction} >> log.txt
mv $onlyCodeZipName $WORKSPACE/APIExample_onlyCode_${BUILD_NUMBER}_$zip_name
if [ "$compress_apiexample" = true ]; then
# Compress only API Example code (without SDK)
echo "Creating code-only package..."
TEMP_ZIP_NAME="temp_code_only.zip"
7za a -tzip $TEMP_ZIP_NAME -r ./$unzip_name/rtc/samples/${android_direction} > log.txt
echo "✅ Code-only package created"

# Generate final output zip name with version
OUTPUT_ZIP_NAME="Shengwang_Native_SDK_for_Android_v${BRANCH_VERSION}_${android_direction}_${BUILD_NUMBER}.zip"
echo "Output zip name: $OUTPUT_ZIP_NAME"
mv $TEMP_ZIP_NAME $WORKSPACE/$OUTPUT_ZIP_NAME

# Display package size
echo "Package size: $(du -h $WORKSPACE/$OUTPUT_ZIP_NAME | cut -f1)"
else
# Compress full SDK with API Example
echo "Creating full package with SDK..."
TEMP_ZIP_NAME="temp_with_sdk.zip"
7za a -tzip $TEMP_ZIP_NAME -r $unzip_name > log.txt
echo "✅ Full package created"

# Generate final output zip name with version (with SDK)
OUTPUT_ZIP_NAME="withSDK_Shengwang_Native_SDK_for_Android_v${BRANCH_VERSION}_${android_direction}_${BUILD_NUMBER}.zip"
echo "Output zip name: $OUTPUT_ZIP_NAME"
mv $TEMP_ZIP_NAME $WORKSPACE/$OUTPUT_ZIP_NAME

# Display package size
echo "Package size: $(du -h $WORKSPACE/$OUTPUT_ZIP_NAME | cut -f1)"
fi
echo ""

if [ $compile_project = true ]; then
echo "Starting project compilation..."
cd ./$unzip_name/rtc/samples/${android_direction} || exit 1
if [ -z "$sdk_url" ] || [ "$sdk_url" = "none" ]; then
./cloud_build.sh false || exit 1
else
./cloud_build.sh true || exit 1
fi
echo "✅ Project compiled successfully"
echo ""
fi

# Calculate and display build duration
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
MINUTES=$((DURATION / 60))
SECONDS=$((DURATION % 60))

echo ""
echo "=========================================="
echo "✅ BUILD COMPLETED SUCCESSFULLY"
echo "=========================================="
echo "Completed at: $(date '+%Y-%m-%d %H:%M:%S')"
if [ $MINUTES -gt 0 ]; then
echo "Total duration: ${MINUTES}m ${SECONDS}s"
else
echo "Total duration: ${SECONDS}s"
fi
echo "Output package: $OUTPUT_ZIP_NAME"
echo "=========================================="

16 changes: 14 additions & 2 deletions .github/ci/build/build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
##################################
export PATH=$PATH:/opt/homebrew/bin

echo "=========================================="
echo "=== Git Branch Debug Information ==="
echo "=========================================="
echo "GIT_BRANCH: $GIT_BRANCH"
echo "BRANCH_NAME: $BRANCH_NAME"
echo "CI_COMMIT_REF_NAME: $CI_COMMIT_REF_NAME"
echo "Git branches:"
git branch -a 2>/dev/null || echo "Unable to list git branches"
echo "Current HEAD:"
git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "Unable to get HEAD"
echo "=========================================="

xcode_version=$(xcodebuild -version | grep Xcode | awk '{print $2}')
echo "Xcode Version: $xcode_version"
echo ios_direction: $ios_direction
Expand Down Expand Up @@ -106,7 +118,7 @@ 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")
sdk_version=$(grep "pod 'ShengwangRtcEngine_iOS'" ./iOS/${ios_direction}/Podfile | sed -n "s/.*'\([0-9.]*\)'.*/\1/p")
echo "sdk_version: $sdk_version"

mkdir -p $cn_dir
Expand All @@ -119,7 +131,7 @@ if [ $compress_apiexample = true ]; then
echo "complete compress api example"
echo "current path: `pwd`"
ls -al
cn_des_path=$WORKSPACE/${apiexample_cn_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip
cn_des_path=$WORKSPACE/${apiexample_cn_name}_v${sdk_version}_APIExample_${BUILD_NUMBER}.zip
echo "cn_des_path: $cn_des_path"
echo "Moving cn_result.zip to $cn_des_path"
mv cn_result.zip $cn_des_path
Expand Down
6 changes: 2 additions & 4 deletions .github/ci/build/build_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if [ $compress_apiexample = true ]; then
echo "complete compress api example"
echo "current path: `pwd`"
ls -al
cn_des_path=$WORKSPACE/${apiexample_cn_name}_${sdk_version}_${BUILD_NUMBER}_APIExample.zip
cn_des_path=$WORKSPACE/${apiexample_cn_name}_v${sdk_version}_APIExample_${BUILD_NUMBER}.zip
echo "cn_des_path: $cn_des_path"
echo "Moving cn_result.zip to $cn_des_path"
mv cn_result.zip $cn_des_path
Expand All @@ -133,6 +133,4 @@ fi
# cd ./$unzip_name/samples/APIExample
# ./cloud_build.sh || exit 1
# cd -
#fi


#fi
Loading