Xwite %!s(int64=3) %!d(string=hai) anos
pai
achega
ca4bdd23c5
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      .github/scripts/cronet.sh

+ 6 - 2
.github/scripts/cronet.sh

@@ -1,11 +1,15 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
 
 
+#分支Stable Dev Beta
 branch=$1
 branch=$1
+#api 最大偏移
+max_offset=$2
+
 [ -z $1 ] && branch=Stable
 [ -z $1 ] && branch=Stable
+[ -z $2 ] && branch=S3
 [ -z $GITHUB_ENV ] && echo "Error: Unexpected github workflow environment" && exit
 [ -z $GITHUB_ENV ] && echo "Error: Unexpected github workflow environment" && exit
 
 
 offset=0
 offset=0
-max_offset=3
 
 
 function fetchExitVersion() {
 function fetchExitVersion() {
     # 获取最新cronet版本
     # 获取最新cronet版本
@@ -23,9 +27,9 @@ function checkVersionExit() {
     if [ $statusCode == "404" ];then
     if [ $statusCode == "404" ];then
         echo "storage.googleapis.com return 404 for cronet $lastest_cronet_version"
         echo "storage.googleapis.com return 404 for cronet $lastest_cronet_version"
         if [[ $max_offset > $offset ]]; then
         if [[ $max_offset > $offset ]]; then
+            offset=$(expr $offset + 1)
             echo "retry with offset $offset"
             echo "retry with offset $offset"
             fetchVersion
             fetchVersion
-            offset=$(expr $offset + 1)
         else
         else
             exist
             exist
         fi
         fi