@@ -9,14 +9,68 @@ permissions:
99 contents : write
1010
1111jobs :
12- build-and-release :
12+
13+ build-esp32 :
1314 runs-on : ubuntu-latest
1415
15- strategy :
16- matrix :
17- board :
18- - { name: "esp32", fqbn: "esp32:esp32:esp32" }
19- - { name: "esp32s3", fqbn: "esp32:esp32:esp32s3" }
16+ steps :
17+ - name : Checkout repository
18+ uses : actions/checkout@v4
19+
20+ - name : Install Arduino CLI
21+ uses : arduino/setup-arduino-cli@v1
22+
23+ - name : Configure Arduino CLI
24+ run : |
25+ arduino-cli config init
26+ arduino-cli config set board_manager.additional_urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
27+ arduino-cli core update-index
28+ arduino-cli core install esp32:esp32
29+
30+ - name : Install required libraries
31+ run : |
32+ arduino-cli lib install "ArduinoJson"
33+ arduino-cli lib install "SerialCommandManager"
34+ arduino-cli lib install "SensorManager"
35+ arduino-cli lib install "SdFat"
36+ arduino-cli lib install "DHT11"
37+
38+ - name : Generate FirmwareVersion.h
39+ run : |
40+ TAG="${GITHUB_REF#refs/tags/}"
41+ VERSION="${TAG#v}"
42+ IFS='.' read -r MAJOR MINOR PATCH BUILD <<< "$VERSION"
43+
44+ printf "#pragma once\n#include <Arduino.h>\n\n// Generated by CI from tag %s - do not edit manually.\nconstexpr uint8_t FirmwareMajor = %s;\nconstexpr uint8_t FirmwareMinor = %s;\nconstexpr uint8_t FirmwarePatch = %s;\nconstexpr uint8_t FirmwareBuild = %s;\n" "$TAG" "$MAJOR" "$MINOR" "$PATCH" "$BUILD" > SmartFuseBox/FirmwareVersion.h
45+
46+ - name : Compile ESP32 firmware
47+ run : |
48+ arduino-cli compile \
49+ --fqbn esp32:esp32:esp32 \
50+ --output-dir SmartFuseBox/build/esp32 \
51+ SmartFuseBox
52+
53+ - name : Rename and checksum ESP32 firmware
54+ run : |
55+ TAG="${GITHUB_REF#refs/tags/}"
56+ SRC="SmartFuseBox/build/esp32/SmartFuseBox.ino.bin"
57+ DEST="SmartFuseBox-esp32-${TAG}.bin"
58+ cp "$SRC" "$DEST"
59+ sha256sum "$DEST" | awk '{print $1}' > "SmartFuseBox-esp32-${TAG}.sha256"
60+
61+ - name : Upload ESP32 firmware to GitHub Release
62+ uses : softprops/action-gh-release@v2
63+ with :
64+ files : |
65+ SmartFuseBox-esp32-${{ github.ref_name }}.bin
66+ SmartFuseBox-esp32-${{ github.ref_name }}.sha256
67+ env :
68+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
69+
70+
71+ build-esp32s3 :
72+ runs-on : ubuntu-latest
73+ needs : build-esp32 # optional, but keeps logs tidy
2074
2175 steps :
2276 - name : Checkout repository
@@ -48,26 +102,26 @@ jobs:
48102
49103 printf "#pragma once\n#include <Arduino.h>\n\n// Generated by CI from tag %s - do not edit manually.\nconstexpr uint8_t FirmwareMajor = %s;\nconstexpr uint8_t FirmwareMinor = %s;\nconstexpr uint8_t FirmwarePatch = %s;\nconstexpr uint8_t FirmwareBuild = %s;\n" "$TAG" "$MAJOR" "$MINOR" "$PATCH" "$BUILD" > SmartFuseBox/FirmwareVersion.h
50104
51- - name : Compile SmartFuseBox firmware
105+ - name : Compile ESP32-S3 firmware
52106 run : |
53107 arduino-cli compile \
54- --fqbn ${{ matrix.board.fqbn }} \
55- --output-dir SmartFuseBox/build/${{ matrix.board.name }} \
108+ --fqbn esp32:esp32:esp32s3 \
109+ --output-dir SmartFuseBox/build/esp32s3 \
56110 SmartFuseBox
57111
58- - name : Rename and checksum firmware
112+ - name : Rename and checksum ESP32-S3 firmware
59113 run : |
60114 TAG="${GITHUB_REF#refs/tags/}"
61- SRC="SmartFuseBox/build/${{ matrix.board.name }} /SmartFuseBox.ino.bin"
62- DEST="SmartFuseBox-${{ matrix.board.name }} -${TAG}.bin"
115+ SRC="SmartFuseBox/build/esp32s3 /SmartFuseBox.ino.bin"
116+ DEST="SmartFuseBox-esp32s3 -${TAG}.bin"
63117 cp "$SRC" "$DEST"
64- sha256sum "$DEST" | awk '{print $1}' > "SmartFuseBox-${{ matrix.board.name }} -${TAG}.sha256"
118+ sha256sum "$DEST" | awk '{print $1}' > "SmartFuseBox-esp32s3 -${TAG}.sha256"
65119
66- - name : Upload to GitHub Release
120+ - name : Upload ESP32-S3 firmware to GitHub Release
67121 uses : softprops/action-gh-release@v2
68122 with :
69123 files : |
70- SmartFuseBox-${{ matrix.board.name }} -${{ github.ref_name }}.bin
71- SmartFuseBox-${{ matrix.board.name }} -${{ github.ref_name }}.sha256
124+ SmartFuseBox-esp32s3 -${{ github.ref_name }}.bin
125+ SmartFuseBox-esp32s3 -${{ github.ref_name }}.sha256
72126 env :
73127 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments