1010 - name : Check out repository
1111 uses : actions/checkout@v2
1212
13- - uses : arduino/compile-sketches@v1
13+ - name : Compile sketch
14+ uses : arduino/compile-sketches@v1
1415 with :
1516 fqbn : " esp32:esp32:esp32s2"
1617 platforms : |
2526 - name: esp32-waveshare-epd
2627 source-path: ./esp32-waveshare-epd
2728 sketch-paths : |
28- - .
29+ - .
30+ cli-compile-flags : |
31+ --output-dir build
32+
33+ - name : Create FIRMWARE.BIN
34+ shell : bash
35+ run : |
36+ set -euo pipefail
37+
38+ if [[ ! -d build ]]; then
39+ echo "ERROR: build/ directory not found."
40+ echo "Workspace directories:"
41+ find . -maxdepth 3 -type d -print
42+ exit 1
43+ fi
44+
45+ echo "Build outputs:"
46+ find build -type f -maxdepth 3 -print
47+
48+ # Pick the main application bin:
49+ # - exclude bootloader/partitions/ota data
50+ # - choose the largest remaining .bin (typically the app firmware)
51+ BIN="$(
52+ find build -type f -name '*.bin' \
53+ ! -name '*bootloader*' \
54+ ! -name '*partitions*' \
55+ ! -name '*ota_data_initial*' \
56+ -printf '%s %p\n' \
57+ | sort -nr \
58+ | head -n 1 \
59+ | awk '{print $2}'
60+ )"
61+
62+ if [[ -z "${BIN:-}" || ! -f "$BIN" ]]; then
63+ echo "ERROR: Could not identify firmware .bin in build/"
64+ echo "All .bin files found:"
65+ find build -type f -name '*.bin' -print
66+ exit 1
67+ fi
68+
69+ echo "Selected firmware bin: $BIN"
70+ cp "$BIN" FIRMWARE.BIN
71+
72+ - name : Upload firmware artifact
73+ uses : actions/upload-artifact@v4
74+ with :
75+ name : firmware
76+ path : FIRMWARE.BIN
77+
78+ - name : Upload full build outputs (optional)
79+ uses : actions/upload-artifact@v4
80+ with :
81+ name : build-outputs
82+ path : build/
0 commit comments