Skip to content

Commit 90c3a65

Browse files
author
HeZhengQing
committed
[FIX] windows ci version check
1 parent 5e8dc87 commit 90c3a65

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/ci/build/build_windows.bat

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ echo build_time: %build_time%
4747
echo pwd: %cd%
4848
echo sdk_url: %sdk_url%
4949

50+
REM Version validation: branch name vs install.ps1 SDK version
51+
for /f "tokens=*" %%a in ('powershell -Command "(Get-Content 'windows\APIExample\install.ps1' -Raw) -match '_v([0-9]+\.[0-9]+\.[0-9]+)' | Out-Null; $matches[1]"') do set SDK_VER=%%a
52+
for /f "tokens=*" %%b in ('powershell -Command "'%api_examples_branch%' -match '([0-9]+\.[0-9]+\.[0-9]+)' | Out-Null; $matches[1]"') do set BRANCH_VER=%%b
53+
if not "%SDK_VER%"=="%BRANCH_VER%" (
54+
echo ERROR: Version mismatch - Branch: %BRANCH_VER%, install.ps1: %SDK_VER%
55+
exit /b 1
56+
)
57+
echo Version validated: %BRANCH_VER%
58+
5059
REM If sdk_url has a value, replace the URL in install.ps1
5160
if not "%sdk_url%"=="" (
5261
if not "%sdk_url%"=="none" (
@@ -66,7 +75,7 @@ echo compile_project: %compile_project%
6675
REM Package APIExample code (only when compress_apiexample=true)
6776
REM Run before compile so package content is not affected by compile
6877
set result_zip=APIExample_result.zip
69-
set des_path=%WORKSPACE%\Shengwang_APIExample_code_windows_%BUILD_NUMBER%.zip
78+
set des_path=%WORKSPACE%\Agora_Native_SDK_for_Windows_v%SDK_VER%_APIExample_%BUILD_NUMBER%.zip
7079
if "%compress_apiexample%"=="true" (
7180
echo "Packaging APIExample code..."
7281

0 commit comments

Comments
 (0)