@@ -271,11 +271,34 @@ jobs:
271271 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
272272
273273 - name : Download all release artifacts
274- uses : actions/download-artifact@v4
275- with :
276- pattern : edgetx-{firmware,cpn-*}-${{ needs.check-tag.outputs.tag_name }}
277- path : release-assets
278- merge-multiple : false # Ensure each artifact stays in its own folder
274+ run : |
275+ TAG="${{ needs.check-tag.outputs.tag_name }}"
276+
277+ COMMIT_SHA=$(git rev-parse $TAG)
278+ echo "Looking for artifacts from commit: $COMMIT_SHA"
279+
280+ # Find all successful workflow runs for this commit
281+ WORKFLOW_RUNS=$(gh run list --commit $COMMIT_SHA --json databaseId,status,conclusion --jq '.[] | select(.conclusion=="success") | .databaseId')
282+
283+ if [ -z "$WORKFLOW_RUNS" ]; then
284+ echo "No successful workflow runs found for commit $COMMIT_SHA"
285+ exit 1
286+ fi
287+
288+ # Download artifacts from each successful run
289+ mkdir -p release-assets
290+ for run_id in $WORKFLOW_RUNS; do
291+ echo "Downloading artifacts from run $run_id..."
292+ gh run download $run_id --dir release-assets --pattern "edgetx-*-${TAG}" || echo "No matching artifacts in run $run_id"
293+ done
294+
295+ # Check if we got any artifacts
296+ if [ ! "$(ls -A release-assets 2>/dev/null)" ]; then
297+ echo "::error::No artifacts found matching pattern edgetx-*-${TAG}"
298+ exit 1
299+ fi
300+ env :
301+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
279302
280303 - name : Package release assets
281304 run : |
0 commit comments