56 lines
1.3 KiB
YAML
56 lines
1.3 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: Remove stale OTA package files
|
|
run: rm -f dist/*.tslpkg
|
|
|
|
- name: Build filesystem-aware OTA package
|
|
run: python scripts/build_ota_package.py
|
|
|
|
- name: Prepare direct OTA files
|
|
run: |
|
|
set -eu
|
|
rm -rf dist/ota
|
|
mkdir -p dist/ota
|
|
count=0
|
|
for file in dist/*.tslpkg; do
|
|
[ -f "$file" ] || continue
|
|
cp "$file" dist/ota/
|
|
count=$((count+1))
|
|
done
|
|
if [ "$count" -eq 0 ]; then
|
|
echo 'No .tslpkg OTA package was produced.' >&2
|
|
exit 1
|
|
fi
|
|
find dist/ota -maxdepth 1 -type f | sort
|
|
|
|
- name: Upload direct OTA files as artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ota-files
|
|
path: dist/ota/*
|
|
if-no-files-found: error
|