From 436b3d6436a5ed459e9326ea0ec3693776d33a54 Mon Sep 17 00:00:00 2001 From: Ben Gardiner Date: Wed, 8 Apr 2026 23:13:49 -0400 Subject: [PATCH] copy the .hex files with a find command --- .github/workflows/build_all.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index d094ccc..25db615 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -258,7 +258,8 @@ jobs: name: Commit firmware to repo needs: [build_all, macro_coverage] if: >- - github.event_name == 'push' && github.ref == 'refs/heads/main' + always() + && github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build_all.result == 'success' runs-on: ubuntu-latest permissions: @@ -287,7 +288,19 @@ jobs: # Default Release → scripts/firmware/ (root) cp dl/default/*.hex scripts/firmware/ - # All variants (including gsusb) → scripts/firmware// + # Show what the download step actually produced + echo "::group::Downloaded artifact layout" + echo "--- dl/default ---" + find dl/default -type f -name '*.hex' 2>/dev/null | head -20 + echo "--- dl/variants ---" + if [ -d dl/variants ]; then + find dl/variants -type f -name '*.hex' 2>/dev/null | head -60 + else + echo "dl/variants/ does not exist" + fi + echo "::endgroup::" + + # All variants → scripts/firmware// variant_count=0 if [ -d dl/variants ]; then for dir in dl/variants/firmware-variant-*/; do @@ -295,8 +308,17 @@ jobs: variant="${dir##*/}" # firmware-variant-kwp variant="${variant#firmware-variant-}" # kwp mkdir -p "scripts/firmware/${variant}" - cp "$dir"*.hex "scripts/firmware/${variant}/" - variant_count=$((variant_count + 1)) + # Copy hex files from the variant directory (may be at root or nested) + if compgen -G "$dir"'*.hex' > /dev/null 2>&1; then + cp "$dir"*.hex "scripts/firmware/${variant}/" + else + find "$dir" -name '*.hex' -type f -exec cp {} "scripts/firmware/${variant}/" \; + fi + copied=$(find "scripts/firmware/${variant}" -name '*.hex' -type f | wc -l) + echo " ${variant}: ${copied} hex file(s)" + if [ "$copied" -gt 0 ]; then + variant_count=$((variant_count + 1)) + fi done fi