Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -287,16 +288,37 @@ jobs:
# Default Release → scripts/firmware/ (root)
cp dl/default/*.hex scripts/firmware/

# All variants (including gsusb) → scripts/firmware/<variant>/
# 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>/
variant_count=0
if [ -d dl/variants ]; then
for dir in dl/variants/firmware-variant-*/; do
[ -d "$dir" ] || continue
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

Expand Down
Loading