diff --git a/release/kokoro/release_linux.sh b/release/kokoro/release_linux.sh index ff27fa7..6375ed2 100755 --- a/release/kokoro/release_linux.sh +++ b/release/kokoro/release_linux.sh @@ -15,9 +15,9 @@ set -e -if ! command -v pip3 &> /dev/null || ! command -v curl &> /dev/null || ! command -v docker &> /dev/null; then +if ! command -v pip3 &> /dev/null || ! command -v curl &> /dev/null || ! command -v docker &> /dev/null || ! command -v git &> /dev/null; then echo "Installing basic dependencies..." - apt-get update && apt-get install -y python3-pip curl + apt-get update && apt-get install -y python3-pip curl git if ! command -v docker &> /dev/null; then echo "Installing docker CLI..." diff --git a/release/kokoro/release_windows.bat b/release/kokoro/release_windows.bat index 75fc8fa..8b6f003 100644 --- a/release/kokoro/release_windows.bat +++ b/release/kokoro/release_windows.bat @@ -51,42 +51,51 @@ echo Created temporary directories: %REPO_DIR%, %TMP_DIR% mkdir "%TMP_DIR%" echo --- Resolving Repository Source --- -if "%DRY_RUN%" == "true" ( - echo [DRY RUN] Using local Kokoro clone instead of cloning main. - set "SRC_DIR=%~dp0..\.." - pushd "!SRC_DIR!" - for /f "tokens=*" %%i in ('git tag --sort=-v:refname 2^>nul') do ( - set "VERSION=%%i" - goto :got_local_tag - ) - set "VERSION=0.1.2" - :got_local_tag +if "%DRY_RUN%" == "true" goto resolution_dry +goto resolution_real + +:resolution_dry +echo [DRY RUN] Using local Kokoro clone instead of cloning main. +set "SRC_DIR=%~dp0..\.." +pushd "!SRC_DIR!" +set "VERSION=" +for /f "tokens=*" %%i in ('git tag --sort=-v:refname 2^>nul') do ( + set "VERSION=%%i" + goto got_local_tag +) +:got_local_tag +if "%VERSION%" == "" set "VERSION=0.1.2" +popd +goto resolution_done + +:resolution_real +mkdir "%REPO_DIR%" +pushd "%REPO_DIR%" +git clone https://github.com/cel-expr/cel-python.git +if !ERRORLEVEL! NEQ 0 ( + echo Failed to clone repository! + set "RELEASE_STATUS=1" popd -) else ( - mkdir "%REPO_DIR%" - pushd "%REPO_DIR%" - git clone https://github.com/cel-expr/cel-python.git - if !ERRORLEVEL! NEQ 0 ( - echo Failed to clone repository! - set "RELEASE_STATUS=1" - popd - goto cleanup - ) - cd cel-python - for /f "tokens=*" %%i in ('git tag --sort=-v:refname') do ( - set "VERSION=%%i" - goto :got_tag - ) - :got_tag - if "%VERSION%" == "" ( - echo Failed to get version tag! - set "RELEASE_STATUS=1" - popd - goto cleanup - ) - set "SRC_DIR=%REPO_DIR%\cel-python" + goto cleanup +) +cd cel-python +set "VERSION=" +for /f "tokens=*" %%i in ('git tag --sort=-v:refname') do ( + set "VERSION=%%i" + goto got_tag +) +:got_tag +if "%VERSION%" == "" ( + echo Failed to get version tag! + set "RELEASE_STATUS=1" popd + goto cleanup ) +set "SRC_DIR=%REPO_DIR%\cel-python" +popd +goto resolution_done + +:resolution_done if "%VERSION:~0,1%" == "v" ( set "VERSION=%VERSION:~1%"