From 6ae29bca59a35eb2cdaec6171575d8421949dafe Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Sat, 11 Apr 2026 17:00:51 -0700 Subject: [PATCH] ota fix --- .github/workflows/custom_build.yml | 7 +++++-- .github/workflows/custom_build_test.yml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/custom_build.yml b/.github/workflows/custom_build.yml index c14d389..38854f1 100644 --- a/.github/workflows/custom_build.yml +++ b/.github/workflows/custom_build.yml @@ -196,12 +196,15 @@ jobs: BUILD_DIR="$ROOT/.pio/build/${{ inputs.target_env }}" MERGED="$BUILD_DIR/firmware-merged.factory.bin" PARTS="$BUILD_DIR/partitions.bin" - OTA_BIN=$(ls "$BUILD_DIR"/mt-*.ota.bin "$BUILD_DIR"/bleota-c3.bin 2>/dev/null | head -1) + OTA_BIN="" + for candidate in "$BUILD_DIR"/mt-*.ota.bin "$BUILD_DIR/bleota-c3.bin"; do + if [ -f "$candidate" ]; then OTA_BIN="$candidate"; break; fi + done if [ -f "$MERGED" ] && [ -f "$PARTS" ] && [ -n "$OTA_BIN" ]; then python3 "${{ github.workspace }}/scripts/extend-merged-with-ota.py" \ "$MERGED" "$PARTS" "$OTA_BIN" else - echo "Skipping OTA extension (merged=$( [ -f "$MERGED" ] && echo yes || echo no), ota=$( [ -n "$OTA_BIN" ] && echo yes || echo no))" + echo "Skipping OTA extension (merged=$([ -f "$MERGED" ] && echo yes || echo no), ota=$([ -n "$OTA_BIN" ] && echo yes || echo no))" fi - name: Stage or generate nRF52 DFU files (if applicable) diff --git a/.github/workflows/custom_build_test.yml b/.github/workflows/custom_build_test.yml index c14d389..38854f1 100644 --- a/.github/workflows/custom_build_test.yml +++ b/.github/workflows/custom_build_test.yml @@ -196,12 +196,15 @@ jobs: BUILD_DIR="$ROOT/.pio/build/${{ inputs.target_env }}" MERGED="$BUILD_DIR/firmware-merged.factory.bin" PARTS="$BUILD_DIR/partitions.bin" - OTA_BIN=$(ls "$BUILD_DIR"/mt-*.ota.bin "$BUILD_DIR"/bleota-c3.bin 2>/dev/null | head -1) + OTA_BIN="" + for candidate in "$BUILD_DIR"/mt-*.ota.bin "$BUILD_DIR/bleota-c3.bin"; do + if [ -f "$candidate" ]; then OTA_BIN="$candidate"; break; fi + done if [ -f "$MERGED" ] && [ -f "$PARTS" ] && [ -n "$OTA_BIN" ]; then python3 "${{ github.workspace }}/scripts/extend-merged-with-ota.py" \ "$MERGED" "$PARTS" "$OTA_BIN" else - echo "Skipping OTA extension (merged=$( [ -f "$MERGED" ] && echo yes || echo no), ota=$( [ -n "$OTA_BIN" ] && echo yes || echo no))" + echo "Skipping OTA extension (merged=$([ -f "$MERGED" ] && echo yes || echo no), ota=$([ -n "$OTA_BIN" ] && echo yes || echo no))" fi - name: Stage or generate nRF52 DFU files (if applicable)