Files
MeshCore-Solo/.github/workflows/build-solo-firmwares.yml
T
JakubandClaude Sonnet 5 a389a733d7 refactor(solo): move solo build configs into their own solo/ folder; one build per board; document all build flags
Solo's `_solo_dual` env for each board lived inside variants/<board>/, mixed
in with the shared upstream board configs (repeater, room server, plain
companion) that every MeshCore fork carries. Split them out into their own
top-level solo/<board>/ folder -- each still `extends` the board base defined
in its original variants/<board>/platformio.ini, just no longer interleaved
with it file-wise.

- platformio.ini: extra_configs picks up solo/*/platformio.ini alongside
  variants/*/platformio.ini.
- build-solo-firmwares.yml: env-discovery grep now scans solo/ instead of
  variants/ (the release matrix is unchanged -- same 8 envs, same names).
- pr-build-check.yml: solo/** added to the trigger paths.
- GAT562 30S Mesh Kit: dropped the separate solo_ble env -- solo_dual is a
  strict superset (BLE still works, plus USB), and every other board only
  ever had one solo build to begin with.
- GAT562 Mesh Watch13: renamed solo_ble -> solo_dual (added DUAL_SERIAL=1) to
  match. No comment anywhere recorded whether this board's USB data lines
  are actually broken out to a connector -- DUAL_SERIAL compiles and works
  over BLE regardless, so worst case the USB half goes unused.
- Removed a dead AUTO_SHUTDOWN_MILLIVOLTS from the three solo envs that set
  it (Heltec V3/V4, T-Echo Lite+KeyShield): that macro is only ever read in
  the old ui-tiny UITask, never ui-new, which every solo build (these
  included) uses -- it did nothing on any of them. Left alone everywhere
  else it's set (non-solo companion envs elsewhere use ui-tiny/ui-orig, or
  the flag is legitimately read); out of scope here.
- Added docs/solo_features/build_flags.md: every optional -D flag a solo
  build understands (GPIO, CardKB/joystick, Hall-sensor cover lock, buzzer/
  vibration, GPS switch, display/battery tuning), verified against the code
  rather than the existing per-board comments, with what's already baked
  into every solo build kept separate from what's opt-in.
- README: doc index + Building from source section link to the new page;
  path references to the moved solo files updated to solo/<board>/.

All 8 solo_dual envs rebuilt clean after the move; native test suite (40
cases) unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-27 00:49:37 +02:00

108 lines
3.2 KiB
YAML

name: Build Solo Firmwares
permissions:
contents: write
on:
workflow_dispatch:
push:
tags:
- 'v*'
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
get-solo-envs:
runs-on: ubuntu-latest
outputs:
envs: ${{ steps.list-envs.outputs.envs }}
steps:
- name: Clone Repo
uses: actions/checkout@v4
- name: List solo_dual envs
id: list-envs
run: |
envs=$(grep -rh '^\[env:' solo/ \
| sed 's/\[env://;s/\]//' \
| grep '_solo_dual$' \
| jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "envs=$envs" >> $GITHUB_OUTPUT
build:
needs: get-solo-envs
runs-on: ubuntu-latest
strategy:
matrix:
env: ${{ fromJson(needs.get-solo-envs.outputs.envs) }}
steps:
- name: Clone Repo
uses: actions/checkout@v4
- name: Setup Build Environment
uses: ./.github/actions/setup-build-environment
- name: Resolve build version
run: |
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
echo "BUILD_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
else
echo "BUILD_VERSION=dev-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
fi
- name: Build Firmware
env:
FIRMWARE_VERSION: ${{ env.BUILD_VERSION }}
run: /usr/bin/env bash build.sh build-firmware ${{ matrix.env }}
- name: Rename firmware
run: |
DEVICE_NAME=$(echo "${{ matrix.env }}" | sed 's/_solo_dual$//;s/_companion$//' | tr '_' '-')
mv out/*.uf2 "out/solo-${{ env.BUILD_VERSION }}-${DEVICE_NAME}.uf2" 2>/dev/null || true
# nRF52 DFU package (adafruit-nrfutil) — used for OTA / BLE-DFU updates.
mv out/*.zip "out/solo-${{ env.BUILD_VERSION }}-${DEVICE_NAME}-ota.zip" 2>/dev/null || true
# ESP32 boards produce .bin instead of .uf2. Only the merged image
# (bootloader + partitions + app, flashed at 0x0) is published: build.sh also
# writes an app-only .bin, but that one needs offset 0x10000 and a bootloader
# already on the chip, so shipping it next to the merged image would only
# invite bricked-looking flashes. Anyone who wants it can build it locally.
mv out/${{ matrix.env }}-*-merged.bin "out/solo-${{ env.BUILD_VERSION }}-${DEVICE_NAME}-merged.bin" 2>/dev/null || true
rm -f out/${{ matrix.env }}-*.bin
- name: Upload Firmware
uses: actions/upload-artifact@v4
with:
name: solo-${{ matrix.env }}-firmware
path: out
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Extract Version from Git Tag
run: echo "GIT_TAG_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Download all solo firmwares
uses: actions/download-artifact@v4
with:
pattern: solo-*-firmware
merge-multiple: true
path: out
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Solo ${{ env.GIT_TAG_VERSION }}
body: ""
draft: true
files: |
out/*.uf2
out/*.zip
out/*-merged.bin