diff --git a/.github/workflows/upload-packages.yml b/.github/workflows/upload-packages.yml index d30f6e2..1b5925e 100644 --- a/.github/workflows/upload-packages.yml +++ b/.github/workflows/upload-packages.yml @@ -45,7 +45,36 @@ jobs: - name: Install .NET SDK uses: nike4613/install-dotnet@533307d1c90c37993c8ef1397388bc9783e7b87c with: - global-json: global.json + global-json: global.json + + - name: Wait for packages to be available + if: github.run_id != inputs.run-id + shell: pwsh + env: + GH_TOKEN: ${{ github.token }} + RUN_ID: ${{ inputs.run-id }} + run: | + while ($true) + { + $conclusion = gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" ` + "/repos/${{ github.repository }}/actions/runs/$(env:RUN_ID)" ` + | ConvertFrom-Json ` + | % { $_.conclusion } + if ($null -ne $conclusion) + { + if ($conclusion -ne "success") + { + echo "Build had conclusion '$conclusion'. Failing."; + exit 1; + } + else + { + echo "Build succeeded. Continuing." + exit 0; + } + } + Start-Sleep -Seconds 30; + } - name: Download compiled packages uses: actions/download-artifact@v4