47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: OTA build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-ota:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install PlatformIO
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install platformio
|
|
|
|
- name: Build OTA firmware binaries
|
|
run: pio run
|
|
|
|
- name: Collect OTA artifacts
|
|
run: |
|
|
mkdir -p dist/ota
|
|
find .pio/build -type f -name 'firmware.bin' -exec cp {} dist/ota/ \;
|
|
count=$(find dist/ota -type f -name '*.bin' | wc -l)
|
|
if [ "$count" -eq 0 ]; then
|
|
echo 'No firmware.bin artifacts were produced.' >&2
|
|
exit 1
|
|
fi
|
|
find dist/ota -maxdepth 1 -type f | sort
|
|
|
|
- name: Upload OTA artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ota-binaries
|
|
path: dist/ota/*.bin
|
|
if-no-files-found: error
|