first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:52:23 +03:00
commit 880f412e2c
2662 changed files with 866266 additions and 0 deletions

45
.github/workflows/scripts/go-utils.sh vendored Executable file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# Shared utilities for Go operations in release scripts
# Usage: source .github/workflows/scripts/go-utils.sh
# Function to perform go get with exponential backoff
# Usage: go_get_with_backoff <package@version>
go_get_with_backoff() {
local package="$1"
local max_attempts=30
local initial_wait=30
local max_wait=120 # 2 minutes
local attempt=1
local wait_time=$initial_wait
echo "🔄 Attempting to get $package with exponential backoff..."
while [ $attempt -le $max_attempts ]; do
echo "📦 Attempt $attempt/$max_attempts: go get $package"
if go get "$package"; then
echo "✅ Successfully retrieved $package on attempt $attempt"
return 0
fi
if [ $attempt -eq $max_attempts ]; then
echo "❌ Failed to get $package after $max_attempts attempts"
return 1
fi
echo "⏳ Waiting ${wait_time}s before retry (attempt $attempt/$max_attempts failed)..."
sleep $wait_time
# Calculate next wait time (exponential backoff)
# Double the wait time, but cap at max_wait
wait_time=$((wait_time * 2))
if [ $wait_time -gt $max_wait ]; then
wait_time=$max_wait
fi
attempt=$((attempt + 1))
done
return 1
}