mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
- Add build-solo-firmwares.yml: auto-detects all _solo_dual envs from platformio.ini, builds in parallel, publishes uf2 files to draft release - Remove build-wio-tracker-l1-firmwares.yml (replaced by solo workflow) - Add WioTrackerL1_companion_solo_dual and WioTrackerL1Eink_companion_solo_dual envs - Wire build-solo-firmwares command in build.sh using _solo_dual suffix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
96 lines
2.4 KiB
YAML
96 lines
2.4 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 '^\[env:' platformio.ini \
|
|
| 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$//' | tr '_' '-')
|
|
mv out/*.uf2 "out/solo-${{ env.BUILD_VERSION }}-${DEVICE_NAME}.uf2" 2>/dev/null || true
|
|
|
|
- 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
|