mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-01 10:21:59 +00:00
- build-solo-sim.yml clones LVGL at the version pinned in solo/wio-tracker-l2/platformio.ini and builds the SIM_UI=lvgl sim into wasm/lvgl/ of solo-sim-wasm.zip, for the site's device switch. - build_wasm.sh: LVGL_DIR can be overridden (CI has no .pio libdeps). - sim_test_set_node_name(): names a sim node, for site screenshots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
95 lines
3.4 KiB
YAML
95 lines
3.4 KiB
YAML
name: Build Solo Sim (WASM)
|
|
|
|
# Builds the companion_radio browser sim (real firmware compiled to WASM via
|
|
# Emscripten, see variants/sim/) -- the OLED ui-new build, the Wio Tracker L2
|
|
# ui-lvgl build and the repeater -- and attaches it to the same draft release
|
|
# build-solo-firmwares.yml creates for this tag, as a single fixed-name
|
|
# asset: solo-sim-wasm.zip. Fixed name (no version in it) so
|
|
# meshcore-solo-site's server-side deploy script can always fetch it from
|
|
# the stable "latest release" download URL without knowing the tag --
|
|
# see meshcore-solo-site/scripts/fetch-wasm-release.sh.
|
|
#
|
|
# Independent job/workflow from the hardware firmware builds: different
|
|
# toolchain (Emscripten, not PlatformIO), and a WASM build failure shouldn't
|
|
# block or delay the actual firmware release.
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build-sim-wasm:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Cache emsdk
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: variants/sim/tools/emsdk
|
|
key: emsdk-6.0.9-${{ runner.os }}
|
|
|
|
- name: Install emsdk 6.0.9
|
|
run: |
|
|
if [ ! -x variants/sim/tools/emsdk/upstream/emscripten/em++ ]; then
|
|
rm -rf variants/sim/tools/emsdk
|
|
git clone --depth 1 https://github.com/emscripten-core/emsdk.git variants/sim/tools/emsdk
|
|
cd variants/sim/tools/emsdk
|
|
python3 ./emsdk.py install 6.0.9
|
|
python3 ./emsdk.py activate 6.0.9
|
|
else
|
|
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
|
|
|
|
# LVGL at the version the L2 firmware pins, straight from its repo --
|
|
# no PlatformIO needed just for the sources.
|
|
- name: Fetch LVGL
|
|
run: |
|
|
LV_VER="$(grep -m1 -oE 'lvgl/lvgl @ [0-9.]+' solo/wio-tracker-l2/platformio.ini | awk '{print $3}')"
|
|
echo "LVGL $LV_VER"
|
|
git clone --depth 1 --branch "v$LV_VER" https://github.com/lvgl/lvgl.git "$RUNNER_TEMP/lvgl"
|
|
|
|
- name: Build L2 (LVGL) WASM
|
|
env:
|
|
FIRMWARE_VERSION: ${{ env.BUILD_VERSION }}
|
|
SIM_UI: lvgl
|
|
LVGL_DIR: ${{ runner.temp }}/lvgl
|
|
run: variants/sim/build_wasm.sh
|
|
|
|
- name: Build repeater WASM
|
|
run: variants/sim/build_wasm_repeater.sh
|
|
|
|
- name: Package
|
|
run: |
|
|
mkdir -p out/wasm/companion out/wasm/lvgl out/wasm/repeater
|
|
cp variants/sim/web/build/meshcore_sim.js variants/sim/web/build/meshcore_sim.wasm out/wasm/companion/
|
|
cp variants/sim/web/build/meshcore_sim_lvgl.js variants/sim/web/build/meshcore_sim_lvgl.wasm out/wasm/lvgl/
|
|
cp variants/sim/web/build/repeater/meshcore_sim_repeater.js variants/sim/web/build/repeater/meshcore_sim_repeater.wasm out/wasm/repeater/
|
|
cd out && zip -r solo-sim-wasm.zip wasm
|
|
|
|
- name: Attach to release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
draft: true
|
|
files: out/solo-sim-wasm.zip
|