Переглянути джерело

fix: remove infinity loop in the release script (#904)

Baptiste Augrain 3 роки тому
батько
коміт
10a0cb4b30
1 змінених файлів з 9 додано та 4 видалено
  1. 9 4
      release.sh

+ 9 - 4
release.sh

@@ -25,17 +25,22 @@ do
     gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
 
     if [[ $? != 0 ]]; then
-      while true
+      for (( i=0; i<10; i++ ))
       do
+        sleep $(( 15 * (i + 1)))
+
         echo "RE-Uploading '${FILE}'"
-        gh release upload --clobber "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
+        gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" --clobber
 
         if [[ $? == 0 ]]; then
           break
         fi
-
-        sleep 30
       done
+
+      if [[ $? != 0 ]]; then
+        echo "'${FILE}' hasn't been uploaded!"
+        exit 1
+      fi
     fi
   fi
 done