diff --git a/.github/workflows/build-solo-sim.yml b/.github/workflows/build-solo-sim.yml index 72e35275..5c24200c 100644 --- a/.github/workflows/build-solo-sim.yml +++ b/.github/workflows/build-solo-sim.yml @@ -46,7 +46,17 @@ jobs: echo "emsdk 6.0.9 already cached" fi + - 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 companion WASM + env: + FIRMWARE_VERSION: ${{ env.BUILD_VERSION }} run: variants/sim/build_wasm.sh - name: Build repeater WASM diff --git a/variants/sim/build_wasm.sh b/variants/sim/build_wasm.sh index 73f801fc..8dc436ff 100755 --- a/variants/sim/build_wasm.sh +++ b/variants/sim/build_wasm.sh @@ -149,6 +149,15 @@ DEFINES=( -DUI_SENSORS_PAGE=1 ) +# The on-device splash's "Solo " bar shows FIRMWARE_VERSION. Without +# it, MyMesh.h falls back to "dev-" -- what the live demo showed +# even for a tagged release. build-solo-sim.yml exports it (tag name for a +# release, "dev-" otherwise), same as build-solo-firmwares.yml does +# for the hardware builds; a local build with it unset keeps the old fallback. +if [ -n "${FIRMWARE_VERSION:-}" ]; then + DEFINES+=("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") +fi + # -funsigned-char: carried over from Phase 1 verbatim -- real ARM cores # default `char` to unsigned; em++'s target (wasm32) defaults it to signed, # same mismatch Phase 1 hit on a native x86/ARM64 host, for the same reason