target_id human readable + motatool

This commit is contained in:
Valentin Kivachuk Burda
2026-06-29 01:46:29 +02:00
parent e7f05eec52
commit 40d1d29a55
20 changed files with 914 additions and 263 deletions
+9 -23
View File
@@ -1,9 +1,10 @@
# Rolling DEV firmware release (fork convenience).
#
# On every push, rebuild a representative set of OTA-capable firmwares (ESP32 + nRF52, one per board family
# plus the RAK4631 / Heltec V3 test boards in every role) and replace the `dev-latest` prerelease assets.
# Each firmware ships a full + same-image-delta `.mota` so the OTA format/transport can be exercised per
# board. UNSIGNED dev builds for testing only.
# plus the RAK4631 / Heltec V3 test boards in every role) and replace the `dev-latest` prerelease assets
# with the flashable binaries (ESP32: .bin/-merged.bin; nRF52: .uf2/.zip). UNSIGNED dev builds for testing.
# OTA `.mota` are not packaged here — build them on demand from a firmware with tools/motatool (which reads
# a .bin or nRF52 .hex directly).
#
# Design (atomic, never-empty): each board builds into a workflow ARTIFACT; a final `release` job collects
# them and ATOMICALLY recreates the release at the end. So if the run is cancelled by the next push, or some
@@ -80,23 +81,8 @@ jobs:
- name: Build ${{ matrix.env }}
run: /usr/bin/env bash build.sh build-firmware ${{ matrix.env }}
- name: Package .mota (full + same-image delta)
run: |
set -euo pipefail
pip install --quiet detools intelhex # detools: delta encoder (motatool shells to it); intelhex: nRF52 .hex extraction
# build the motatool packager (C++; OpenSSL for sha256+ed25519)
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libssl-dev cmake g++ >/dev/null
cmake -S tools/motatool -B tools/motatool/build -DCMAKE_BUILD_TYPE=Release >/dev/null
cmake --build tools/motatool/build -j"$(nproc)" >/dev/null
SHA=$(git rev-parse --short HEAD)
python3 tools/mota/dev_motas.py \
--env "${{ matrix.env }}" --platform "${{ matrix.platform }}" \
--build-dir ".pio/build/${{ matrix.env }}" --target-env "${{ matrix.env }}" \
--out-prefix "out/${{ matrix.env }}-${FIRMWARE_VERSION}-${SHA}" --work /tmp \
--motatool "$PWD/tools/motatool/build/motatool" \
|| echo "::warning::.mota packaging failed for ${{ matrix.env }}"
# build.sh writes the flashable firmware into out/ (ESP32: .bin + -merged.bin; nRF52: .uf2 + .zip).
# OTA .mota are NOT packaged in CI — build them locally with tools/motatool when needed.
- name: Upload this board's artifact
uses: actions/upload-artifact@v7
@@ -149,9 +135,9 @@ jobs:
⚠️ Unsigned dev builds for testing only. Assets are replaced on every push (this release always
tracks the latest commit). Embedded firmware version string: \`dev-<short-sha>\`.
A representative set of OTA-capable boards (ESP32 + nRF52). Each firmware ships a \`.full.mota\`
(the flashable image) and a \`.delta.mota\` (a same-image patch — intentionally tiny — to exercise
the delta path: sequential on ESP32, in-place on nRF52/RAK4631).
A representative set of OTA-capable boards (ESP32 + nRF52): flashable firmware binaries
(ESP32 \`.bin\`/\`-merged.bin\`, nRF52 \`.uf2\`/\`.zip\`). To make an OTA \`.mota\` from one of
these, use \`tools/motatool\` (it reads a \`.bin\` or nRF52 \`.hex\` directly).
EOF
)
# delete + recreate so removed boards don't leave stale assets; assets are ready, so it's atomic