From 5f34956f82dba573450444b515ad5f84518ca995 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Wed, 9 Apr 2025 14:38:05 +0200 Subject: [PATCH] ci: Retry sentry-cli if it fails to upload symbols --- ci_scripts/ci_post_xcodebuild.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ci_scripts/ci_post_xcodebuild.sh b/ci_scripts/ci_post_xcodebuild.sh index ff8eb24aab..b825dc6414 100755 --- a/ci_scripts/ci_post_xcodebuild.sh +++ b/ci_scripts/ci_post_xcodebuild.sh @@ -12,10 +12,21 @@ mise install eval "$(mise activate bash --shims)" -if [[ -n $CI_ARCHIVE_PATH ]]; -then - # Upload dSYMs - sentry-cli --url $SENTRY_URL --auth-token $SENTRY_AUTH_TOKEN upload-dif --org sentry --project $SENTRY_PROJECT --include-sources $CI_DERIVED_DATA_PATH +if [[ -n $CI_ARCHIVE_PATH ]]; then + retries=0 + max_retries=3 + until [ $retries -ge $max_retries ] + do + sentry-cli --url $SENTRY_URL --auth-token $SENTRY_AUTH_TOKEN upload-dif --org sentry --project $SENTRY_PROJECT --include-sources $CI_DERIVED_DATA_PATH && break + retries=$((retries+1)) + echo "Retry $retries/$max_retries for sentry-cli failed." + sleep 2 + done + + if [ $retries -eq $max_retries ]; then + echo "sentry-cli failed after $max_retries attempts." + exit 1 + fi else echo "Archive path isn't available. Unable to run dSYMs uploading script." fi