diff --git a/.github/workflows/fetch-encrypted-secrets.yml b/.github/workflows/fetch-encrypted-secrets.yml index 90d7a94..5461b4c 100644 --- a/.github/workflows/fetch-encrypted-secrets.yml +++ b/.github/workflows/fetch-encrypted-secrets.yml @@ -12,27 +12,31 @@ jobs: runs-on: ubuntu-latest steps: - name: Download with Retry - shell: python - run: | - import requests - import json - import time + uses: nick-fields/retry@v3 + with: + timeout_minutes: 1 + max_attempts: 3 + shell: python + command: | + import requests + import json + import time - input_data = json.loads('${{ inputs.zip_url_json }}') - url = f"{input_data['url']}/get_zip?filename={input_data['file']}" - - for attempt in range(5): - try: - print(f"Downloading (Attempt {attempt + 1})...") - r = requests.get(url, timeout=20) - r.raise_for_status() - with open('secrets.zip', 'wb') as f: - f.write(r.content) - break - except Exception as e: - if attempt < 4: - time.sleep(5 * (2 ** attempt)) - else: raise e + input_data = json.loads('${{ inputs.zip_url_json }}') + url = f"{input_data['url']}/get_zip?filename={input_data['file']}" + + for attempt in range(5): + try: + print(f"Downloading (Attempt {attempt + 1})...") + r = requests.get(url, timeout=20) + r.raise_for_status() + with open('secrets.zip', 'wb') as f: + f.write(r.content) + break + except Exception as e: + if attempt < 4: + time.sleep(5 * (2 ** attempt)) + else: raise e - name: Upload Encrypted Artifact uses: actions/upload-artifact@v4 diff --git a/.github/workflows/generator-windows.yml b/.github/workflows/generator-windows.yml index dfa3a84..11b9297 100644 --- a/.github/workflows/generator-windows.yml +++ b/.github/workflows/generator-windows.yml @@ -43,17 +43,9 @@ env: jobs: setup: - name: setup - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - uses: Wandalen/wretry.action@master - with: - action: ./.github/workflows/fetch-encrypted-secrets.yml - with: | - zip_url_json: ${{ inputs.zip_url }} + uses: ./.github/workflows/fetch-encrypted-secrets.yml + with: + zip_url_json: ${{ inputs.zip_url }} generate-bridge: uses: ./.github/workflows/bridge.yml @@ -93,7 +85,7 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - + - uses: actions/download-artifact@v4 with: name: encrypted-secrets-zip