Files
waterlevel-software/.gitea/workflows/on_push.yaml
tobimai 3dc339c449
All checks were successful
Compilie project and upload binaries / test (push) Successful in 3m59s
fix ota upload
2025-11-05 22:08:42 +01:00

53 lines
2.0 KiB
YAML

name: Compilie project and upload binaries
on:
push:
branches: ["main"]
jobs:
test:
runs-on: ubuntu-latest
container:
image: gitea.tobiasmaier.me/tobimai/devcontainer-pio:2.1
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Run PlatformIO build for SPIFFS (same in both platforms, so only one build is necessary)
run: which pio && id && pio run --target buildfs -e ESP32_INA233
- name: Run PlatformIO Tests
run: pio test -e native
- name: Run PlatformIO build for INA233
run: pio run -e ESP32_INA233
- name: Run PlatformIO build for INA226
run: pio run -e ESP32_INA226
- name: Upload firmware binary for INA233
run: |
VERSION=$(sed -n 's/#define current_software_version Version{[[:space:]]*\([0-9]\+\),[[:space:]]*\([0-9]\+\),[[:space:]]*\([0-9]\+\)}/\1.\2.\3/p' src/global_data/defines.h)
echo "Extracted version: $VERSION"
curl -X PUT \
-H "Content-Type: application/octet-stream" \
--data-binary @.pio/build/ESP32_INA233/firmware.bin \
https://iot.tobiasmaier.me/firmware/waterlevel/INA233REV2/${VERSION}
- name: Upload firmware binary for INA226
run: |
VERSION=$(sed -n 's/#define current_software_version Version{[[:space:]]*\([0-9]\+\),[[:space:]]*\([0-9]\+\),[[:space:]]*\([0-9]\+\)}/\1.\2.\3/p' src/global_data/defines.h)
echo "Extracted version: $VERSION"
curl -X PUT \
-H "Content-Type: application/octet-stream" \
--data-binary @.pio/build/ESP32_INA226/firmware.bin \
https://iot.tobiasmaier.me/firmware/waterlevel/INA226REV2/${VERSION}
- name: Upload SPIFFS binary
run: |
VERSION=$(cat data/version)
echo "Extracted version: $VERSION"
curl -X PUT \
-H "Content-Type: application/octet-stream" \
--data-binary @.pio/build/ESP32_INA233/littlefs.bin \
https://iot.tobiasmaier.me/filesystem/waterlevel/generic/${VERSION}.0.0