Merge observer OTA channel switching into keymindCascade
This commit is contained in:
commit
63f4642252
32 files changed
+3090
-1708
No files matched your search
@@ -67,6 +67,10 @@ env:
|
||||
# The channel itself. Firmware fetches <OTA_MANIFEST_BASE>/<OTA_VARIANT>.json,
|
||||
# so this URL is what keeps beta nodes on beta.
|
||||
OTA_MANIFEST_BASE_URL: https://observer.gessaman.com/beta/v
|
||||
# Both channel bases are baked into every build so `ota branch prod|beta` can
|
||||
# move a node between channels. Identical in both observer workflows.
|
||||
OTA_MANIFEST_BASE_STABLE_URL: https://observer.gessaman.com/v
|
||||
OTA_MANIFEST_BASE_DEV_URL: https://observer.gessaman.com/beta/v
|
||||
# Marks the embedded version, e.g. v1.16.0.3-observer-beta-dev-abc1234, so `ver`
|
||||
# (and the MQTT firmware_version / SNMP) identify BOTH the channel and its
|
||||
# provenance: this channel is built from the upstream-dev-merged line, so "dev"
|
||||
@@ -168,20 +172,9 @@ jobs:
|
||||
run: /usr/bin/env bash build.sh build-firmware ${{ matrix.shard.envs }}
|
||||
|
||||
- name: Verify beta channel is baked in
|
||||
shell: bash
|
||||
run: |
|
||||
# Fail fast rather than publish firmware that would OTA itself onto the
|
||||
# production channel. Checks one built binary actually carries the beta
|
||||
# manifest URL and does NOT carry the production one.
|
||||
BIN=$(find .pio/build -name firmware.elf | head -1)
|
||||
if [ -z "$BIN" ]; then echo "no ELF found to verify" >&2; exit 1; fi
|
||||
if ! strings "$BIN" | grep -qF "$OTA_MANIFEST_BASE_URL"; then
|
||||
echo "ERROR: beta manifest base missing from $BIN" >&2; exit 1
|
||||
fi
|
||||
if strings "$BIN" | grep -qE 'https://observer\.gessaman\.com/v"?$'; then
|
||||
echo "ERROR: production manifest base present in a beta build" >&2; exit 1
|
||||
fi
|
||||
echo "OK: $BIN carries $OTA_MANIFEST_BASE_URL"
|
||||
# Fail fast rather than publish firmware that would OTA itself onto the
|
||||
# production channel: checks every .bin the shard publishes.
|
||||
run: python3 scripts/verify_ota_channel.py --expect beta --required-cap keymind1
|
||||
|
||||
- name: Upload Shard Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -258,7 +251,7 @@ jobs:
|
||||
# this channel's dropdown changelog. Non-fatal -- stale notes beat a
|
||||
# red build whose binaries are already live.
|
||||
{
|
||||
printf '%s' '<p><b>⚠ DEV/BETA CHANNEL:</b> pre-release firmware. A node flashed from this channel keeps receiving OTA updates from this channel until re-flashed by cable.</p>'
|
||||
printf '%s' '<p><b>⚠ DEV/BETA CHANNEL:</b> pre-release firmware. A node flashed from this channel keeps receiving OTA updates from this channel unless changed with ota branch prod and ota update. The target must preserve its saved-settings format and required transports.</p>'
|
||||
cat firmware-notes.html
|
||||
} > /tmp/beta-notes.html
|
||||
gh_retry gh release edit "$RELEASE_TAG" --notes-file /tmp/beta-notes.html \
|
||||
|
||||
@@ -54,6 +54,10 @@ env:
|
||||
# same value the build was handed instead of a second hardcoded copy. Must match
|
||||
# build.sh's OTA_MANIFEST_BASE_URL default and the Pages path serving flasher/v.
|
||||
OTA_MANIFEST_BASE_URL: https://observer.gessaman.com/v
|
||||
# Both channel bases are baked into every build so `ota branch prod|beta` can
|
||||
# move a node between channels. Identical in both observer workflows.
|
||||
OTA_MANIFEST_BASE_STABLE_URL: https://observer.gessaman.com/v
|
||||
OTA_MANIFEST_BASE_DEV_URL: https://observer.gessaman.com/beta/v
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -144,21 +148,9 @@ jobs:
|
||||
run: /usr/bin/env bash build.sh build-firmware ${{ matrix.shard.envs }}
|
||||
|
||||
- name: Verify production channel is baked in
|
||||
shell: bash
|
||||
run: |
|
||||
# Mirror of the beta workflow's guard, which production lacked. Fail fast
|
||||
# rather than publish firmware that would OTA itself onto the wrong
|
||||
# channel: the manifest base is a compile-time -D, so a build that lost
|
||||
# it (or picked up beta's) is invisible until a node tries `ota check`.
|
||||
BIN=$(find .pio/build -name firmware.elf | head -1)
|
||||
if [ -z "$BIN" ]; then echo "no ELF found to verify" >&2; exit 1; fi
|
||||
if ! strings "$BIN" | grep -qF "$OTA_MANIFEST_BASE_URL"; then
|
||||
echo "ERROR: production manifest base missing from $BIN" >&2; exit 1
|
||||
fi
|
||||
if strings "$BIN" | grep -qF 'https://observer.gessaman.com/beta/v'; then
|
||||
echo "ERROR: beta manifest base present in a production build" >&2; exit 1
|
||||
fi
|
||||
echo "OK: $BIN carries $OTA_MANIFEST_BASE_URL"
|
||||
# Fail fast rather than publish firmware that would OTA itself onto the
|
||||
# wrong channel: checks every .bin the shard publishes.
|
||||
run: python3 scripts/verify_ota_channel.py --expect prod --required-cap keymind1
|
||||
|
||||
- name: Upload Shard Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
@@ -160,10 +160,8 @@ jobs:
|
||||
- name: Build Shard ${{ matrix.shard.idx }}
|
||||
env:
|
||||
FIRMWARE_BUILD_NUMBER: ${{ needs.enumerate.outputs.build_number }}
|
||||
# Channel isolation for device pull-OTA: appended after the per-env
|
||||
# ini flags, so this definition of OTA_MANIFEST_BASE wins. build.sh
|
||||
# appends its own version/OTA_VARIANT flags to this variable.
|
||||
PLATFORMIO_BUILD_FLAGS: -D OTA_MANIFEST_BASE='"${{ env.OTA_MANIFEST_BASE_URL }}"'
|
||||
# build.sh uses the workflow's OTA_MANIFEST_BASE_URL for native OTA
|
||||
# and supplies the named production and beta channel bases.
|
||||
run: /usr/bin/env bash build.sh build-firmware ${{ matrix.shard.envs }}
|
||||
|
||||
- name: Upload Shard Artifact
|
||||
|
||||
@@ -89,7 +89,14 @@ jobs:
|
||||
python3 -B scripts/check_arduinojson_pin.py
|
||||
|
||||
- name: Run Unit Tests
|
||||
run: pio test -e native -e native_kiss_modem -vv
|
||||
run: pio test -e native -e native_kiss_modem -e native_ota_channel -vv
|
||||
|
||||
- name: Verify OTA channel persistence and published image tags
|
||||
run: |
|
||||
python3 -B test/test_ota_channel_persistence.py -v
|
||||
python3 -B test/test_observer_ota_channel.py -v
|
||||
python3 -B test/test_observer_build_channels.py -v
|
||||
python3 -B scripts/verify_ota_channel.py --self-test
|
||||
|
||||
- name: Verify build output cleanup safety
|
||||
run: python3 -B test/test_build_output_safety.py -v
|
||||
|
||||
Reference in new issue
Block a user