54 lines
2.4 KiB
YAML
54 lines
2.4 KiB
YAML
name: Build using Github Actions
|
|
on: [push, pull_request]
|
|
jobs:
|
|
build-source:
|
|
name: Checkout source code and build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y python3-serial cmake
|
|
- name: Install Arduino IDE
|
|
run: |
|
|
curl -L https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -o /tmp/arduino-ide.tar.xz
|
|
tar -xf /tmp/arduino-ide.tar.xz --directory ~/
|
|
cd ~/arduino*
|
|
./install.sh
|
|
./arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" --save-prefs
|
|
./arduino --install-boards esp32:esp32:2.0.14
|
|
- name: Install Arduino CMake Toolchain
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: technyon/Arduino-CMake-Toolchain
|
|
path: arduino-toolchain
|
|
- name: Build
|
|
run: |
|
|
mkdir -p build
|
|
cd build
|
|
touch file_opts
|
|
cmake -D CMAKE_TOOLCHAIN_FILE=../arduino-toolchain/Arduino-toolchain.cmake ..
|
|
echo "# Espressif ESP32 Partition Table" > partitions.csv
|
|
echo "# Name, Type, SubType, Offset, Size, Flags" >> partitions.csv
|
|
echo "nvs, data, nvs, 0x9000, 0x5000," >> partitions.csv
|
|
echo "otadata, data, ota, 0xe000, 0x2000," >> partitions.csv
|
|
echo "app0, app, ota_0, 0x10000, 0x1E0000," >> partitions.csv
|
|
echo "app1, app, ota_1, 0x1F0000,0x1E0000," >> partitions.csv
|
|
echo "spiffs, data, spiffs, 0x3D0000,0x30000," >> partitions.csv
|
|
make
|
|
- name: Upload artifacts
|
|
run: |
|
|
mkdir release
|
|
cp build/nuki_hub.bin release/
|
|
cp build/nuki_hub.partitions.bin release/
|
|
cp $(find ~/.arduino15/packages/esp32/ | grep boot_app0.bin) release/
|
|
echo "esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 boot_app0.bin 0x1000 bootloader_dio_80m.bin 0x10000 nuki_hub.bin 0x8000 nuki_hub.partitions.bin" > release/flash.sh
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: release-assets
|
|
path: release/
|
|
|