From f44e2509ab159e8642fb1708c9bb6bfb5907ea73 Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Thu, 3 Sep 2026 17:29:36 -0500 Subject: [PATCH] ci: publish .uf2 test builds (RP2350) alongside .hex in PR releases Backport of #11856 (merged to maintenance-10.x) to release/9.1. The PR Test Builds workflow is triggered by workflow_run, which executes from the default branch (master); master is fed from release/9.1, so this must land here (and ride 9.1 -> master) for PR test-build releases to attach .uf2. - ci.yml: upload ./build/*.uf2 alongside *.hex in the firmware matrix and single-target jobs (upload-artifact unions the globs and defaults if-no-files-found: warn, so jobs without a .uf2 are unaffected). - pr-test-builds.yml: attach hexes/*.uf2 to the PR test-build release when present (guarded so PRs with no .uf2 don't pass a literal unmatched glob), and mention it in the release notes. The .uf2 itself is produced by RP2350 targets via the in-tree elf2uf2.py (python3, always on runners); no picotool dependency. --- .github/workflows/ci.yml | 8 ++++++-- .github/workflows/pr-test-builds.yml | 11 +++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6232c17b431..458262cb58b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,7 +127,9 @@ jobs: uses: actions/upload-artifact@v4 with: name: matrix-${{ env.BUILD_NAME }}.${{ matrix.id }} - path: ./build/*.hex + path: | + ./build/*.hex + ./build/*.uf2 retention-days: 1 - name: Upload size report uses: actions/upload-artifact@v4 @@ -167,7 +169,9 @@ jobs: uses: actions/upload-artifact@v4 with: name: matrix-${{ env.BUILD_NAME }}.single - path: ./build/*.hex + path: | + ./build/*.hex + ./build/*.uf2 retention-days: 1 - name: Upload size report uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr-test-builds.yml b/.github/workflows/pr-test-builds.yml index f969f40218c..19867077aa5 100644 --- a/.github/workflows/pr-test-builds.yml +++ b/.github/workflows/pr-test-builds.yml @@ -86,10 +86,17 @@ jobs: PR_URL="https://github.com/${REPO}/pull/${PR_NUMBER}" printf '%s\n\n%s\n\n%s\n' \ "Test build for [PR #${PR_NUMBER}](${PR_URL}) — commit \`${SHORT_SHA}\`" \ - "**${HEX_COUNT} targets built.** Find your board's \`.hex\` file by name (e.g. \`MATEKF405SE.hex\`)." \ + "**${HEX_COUNT} targets built.** Find your board's \`.hex\` file by name (e.g. \`MATEKF405SE.hex\`); targets that also publish a \`.uf2\` (e.g. \`RP2350_PICO\`) attach it alongside for BOOTSEL drag-and-drop flashing." \ "> Development build for testing only. Use Full Chip Erase when flashing." \ > release-notes.md - gh release create "pr-${PR_NUMBER}" hexes/*.hex \ + # Attach .uf2 images when present (RP2350 targets publish them for + # BOOTSEL drag-and-drop). Build an explicit asset list so a PR that + # produced no .uf2 doesn't pass a literal unmatched glob to gh. + ASSETS=(hexes/*.hex) + if compgen -G "hexes/*.uf2" > /dev/null; then + ASSETS+=(hexes/*.uf2) + fi + gh release create "pr-${PR_NUMBER}" "${ASSETS[@]}" \ --repo iNavFlight/pr-test-builds \ --prerelease \ --title "PR #${PR_NUMBER} (${SHORT_SHA})" \