@@ -152,28 +152,34 @@ jobs:
152
152
- name : fetch tinyuf2 combined.bin
153
153
run : |
154
154
BOARD_NAME="${{fromJson(steps.get_board_json.outputs.boardJson).bootloaderBoardName}}"
155
+ set +e
155
156
for attempt in 1 2; do
156
157
echo "Attempt $attempt: Fetching tinyuf2 release info for board $BOARD_NAME"
157
158
API_RESPONSE=$(curl --silent --fail https://api.github.com/repos/adafruit/tinyuf2/releases/latest)
158
159
if [ $? -ne 0 ]; then
159
160
echo "Attempt $attempt: curl failed to fetch release info."
160
161
if [ "$attempt" -eq 2 ]; then exit 1; else sleep 2; continue; fi
161
162
fi
162
- DOWNLOAD_URL=$(echo "$API_RESPONSE" | jq -r '.assets[] | select(.browser_download_url | contains("tinyuf2-'$BOARD_NAME'-") and endswith(".zip")) | .browser_download_url // empty')
163
- if [ -z "$DOWNLOAD_URL" ]; then
164
- echo "Attempt $attempt: No matching tinyuf2 zip found for board $BOARD_NAME ."
163
+ DOWNLOAD_URL=$(echo "$API_RESPONSE" | jq -r '.assets[] | select(.browser_download_url | contains("tinyuf2-'$BOARD_NAME'-") and endswith(".zip")) | .browser_download_url // empty'); JQ_EXIT=$?
164
+ if [ $JQ_EXIT -ne 0 ] || [ -z "$DOWNLOAD_URL" ]; then
165
+ echo "Attempt $attempt: jq failed or no matching zip found ."
165
166
if [ "$attempt" -eq 2 ]; then exit 1; else sleep 2; continue; fi
166
167
fi
167
168
echo "Attempt $attempt: Downloading $DOWNLOAD_URL"
168
169
wget "$DOWNLOAD_URL" -O tinyuf2.zip
169
170
if [ $? -eq 0 ]; then
170
171
unzip -o tinyuf2.zip -d .
172
+ if [ $? -ne 0 ]; then
173
+ echo "Attempt $attempt: unzip failed"
174
+ if [ "$attempt" -eq 2 ]; then exit 1; else sleep 2; continue; fi
175
+ fi
171
176
break
172
177
else
173
178
echo "Attempt $attempt: wget failed to download $DOWNLOAD_URL"
174
179
if [ "$attempt" -eq 2 ]; then exit 1; else sleep 2; fi
175
180
fi
176
181
done
182
+ set -e
177
183
- name : move partition and bootloader files for tinyuf2 (to match flash_args)
178
184
run : |
179
185
# Copy files where they're expected to make flash_args happy
0 commit comments