Skip to content

Commit fb0c0a1

Browse files
Merge pull request #44 from davidkreidler/auto_generate_FIRMWARE.BIN
Autogenerate FIRMWARE.BIN
2 parents b952ef2 + 5937969 commit fb0c0a1

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

.github/workflows/arduino_build.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ jobs:
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: Compile sketch
14+
uses: arduino/compile-sketches@v1
1415
with:
1516
fqbn: "esp32:esp32:esp32s2"
1617
platforms: |
@@ -25,4 +26,36 @@ jobs:
2526
- name: esp32-waveshare-epd
2627
source-path: ./esp32-waveshare-epd
2728
sketch-paths: |
28-
- .
29+
- .
30+
31+
- name: Stage firmware into ./build/... and rename to FIRMWARE.BIN
32+
shell: bash
33+
run: |
34+
set -euo pipefail
35+
36+
BIN="$(
37+
find /home/runner -type f -name 'OpenCO2_Sensor.ino.bin' \
38+
! -name '*bootloader*' \
39+
! -name '*partitions*' \
40+
! -name '*ota_data_initial*' \
41+
2>/dev/null \
42+
| head -n 1
43+
)"
44+
45+
if [[ -z "${BIN:-}" || ! -f "$BIN" ]]; then
46+
echo "ERROR: Could not find OpenCO2_Sensor.ino.bin on runner."
47+
echo "Debug: listing any .ino.bin files under /home/runner:"
48+
find /home/runner -type f -name '*.ino.bin' 2>/dev/null | head -n 200 || true
49+
exit 1
50+
fi
51+
52+
echo "Found firmware: $BIN"
53+
mkdir -p build/esp32.esp32.esp32s2
54+
cp "$BIN" build/esp32.esp32.esp32s2/OpenCO2_Sensor.ino.bin
55+
cp build/esp32.esp32.esp32s2/OpenCO2_Sensor.ino.bin FIRMWARE.BIN
56+
57+
- name: Upload FIRMWARE.BIN artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: FIRMWARE.BIN
61+
path: FIRMWARE.BIN

0 commit comments

Comments
 (0)