88
99 steps :
1010 - name : Check out repository
11- uses : actions/checkout@v2
11+ uses : actions/checkout@v4
1212
13- - uses : arduino/compile-sketches@v1
13+ - name : Setup Arduino CLI
14+ uses : arduino/setup-arduino-cli@v2
1415 with :
15- fqbn : " esp32:esp32:esp32s2"
16- platforms : |
17- - name: esp32:esp32
18- source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
19- version: 3.2.0
20- libraries : |
21- - name: FastLED
22- - name: Sensirion Core
23- - name: Sensirion I2C SCD4x
24- - name: WiFiManager
25- - name: esp32-waveshare-epd
26- source-path: ./esp32-waveshare-epd
27- sketch-paths : |
28- - .
16+ version : " 1.1.1"
17+
18+ - name : Install ESP32 core + libraries
19+ shell : bash
20+ run : |
21+ set -euo pipefail
22+
23+ ESP_URL="https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
24+
25+ arduino-cli core update-index --additional-urls "$ESP_URL"
26+ arduino-cli core install esp32:esp32@3.2.0 --additional-urls "$ESP_URL"
27+
28+ arduino-cli lib update-index
29+ arduino-cli lib install "FastLED" "Sensirion Core" "Sensirion I2C SCD4x" "WiFiManager"
30+
31+ - name : Compile and export binaries
32+ shell : bash
33+ run : |
34+ set -euo pipefail
35+
36+ # Find the sketch (.ino). If you have multiple, hardcode one path here.
37+ INO="$(find . -maxdepth 3 -type f -name '*.ino' | head -n 1)"
38+ if [[ -z "${INO:-}" ]]; then
39+ echo "ERROR: No .ino sketch found."
40+ exit 1
41+ fi
42+
43+ SKETCH_DIR="$(dirname "$INO")"
44+ echo "Using sketch: $INO"
45+ echo "Sketch directory: $SKETCH_DIR"
46+
47+ arduino-cli compile \
48+ --fqbn "esp32:esp32:esp32s2" \
49+ --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" \
50+ --library "$GITHUB_WORKSPACE/esp32-waveshare-epd" \
51+ --export-binaries \
52+ "$SKETCH_DIR"
53+
54+ echo "Exported binaries:"
55+ find "$SKETCH_DIR" -type f -name '*.bin' -print || true
56+
57+ - name : Create FIRMWARE.BIN
58+ shell : bash
59+ run : |
60+ set -euo pipefail
61+
62+ BIN="$(
63+ find . -type f -name '*.bin' \
64+ ! -path '*/.git/*' \
65+ ! -name '*bootloader*' \
66+ ! -name '*partitions*' \
67+ ! -name '*ota_data_initial*' \
68+ -printf '%s %p\n' \
69+ | sort -nr \
70+ | head -n 1 \
71+ | awk '{print $2}'
72+ )"
73+
74+ if [[ -z "${BIN:-}" || ! -f "$BIN" ]]; then
75+ echo "ERROR: No firmware .bin found."
76+ echo "All .bin files found:"
77+ find . -type f -name '*.bin' -print || true
78+ exit 1
79+ fi
80+
81+ echo "Selected firmware bin: $BIN"
82+ cp "$BIN" FIRMWARE.BIN
83+
84+ - name : Upload firmware artifact
85+ uses : actions/upload-artifact@v4
86+ with :
87+ name : firmware
88+ path : FIRMWARE.BIN
0 commit comments