-
Notifications
You must be signed in to change notification settings - Fork 123
57 lines (43 loc) · 2.32 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Build binary
on: [push, pull_request]
env:
ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS: "http://arduino.esp8266.com/stable/package_esp8266com_index.json https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Update version.h
if: github.ref != 'refs/heads/main' #do not change version in main branch run
run: cd HeishaMon && echo "static const char *heishamon_version = \"Alpha-$(git rev-parse --short HEAD)\";" > version.h && cat version.h
shell: bash
- name: Setup Arduino CLI
uses: arduino/[email protected]
- name: Install platform
run: |
arduino-cli core update-index
arduino-cli core install esp8266:esp8266
arduino-cli core install esp32:esp32
- name: Install dependencies
run: arduino-cli lib install ringbuffer pubsubclient arduinojson dallastemperature onewire "Adafruit NeoPixel"
- name: Fix Onewire lib for ESP32-3.0.0
run: |
sed -i '/#include <driver\/rtc_io\.h>/a\
#include <soc\/gpio_struct\.h>' \
/home/runner/Arduino/libraries/OneWire/util/OneWire_direct_gpio.h
- name: Compile Sketch for ESP8266
run: cd HeishaMon && arduino-cli compile --output-dir . --fqbn=esp8266:esp8266:d1_mini:xtal=160,vt=flash,ssl=basic,mmu=3216,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600 --warnings=none --verbose HeishaMon.ino
- name: Add MD5 checksum to ESP8266 binary
run: cd HeishaMon && MD5=`md5sum HeishaMon.ino.bin | cut -d\ -f1` && mv HeishaMon.ino.bin HeishaMon_ESP8266-alpha-$MD5.bin
shell: bash
- name: Compile Sketch for ESP32
run: cd HeishaMon && arduino-cli compile --output-dir . --fqbn=esp32:esp32:esp32s3:CDCOnBoot=cdc,PSRAM=enabled,PartitionScheme=min_spiffs --warnings=none --verbose HeishaMon.ino
- name: Add MD5 checksum to ESP32 binary
run: cd HeishaMon && MD5=`md5sum HeishaMon.ino.bin | cut -d\ -f1` && mv HeishaMon.ino.bin HeishaMon_ESP32-alpha-$MD5.bin
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: HeishaMon.ino.bin
path: HeishaMon/HeishaMon_*.bin