platformio
This commit is contained in:
112
.github/workflows/build.yml
vendored
112
.github/workflows/build.yml
vendored
@@ -1,53 +1,79 @@
|
||||
name: Build using Github Actions
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
build-source:
|
||||
build:
|
||||
name: Checkout source code and build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
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.15
|
||||
- name: Install Arduino CMake Toolchain
|
||||
uses: actions/checkout@v2
|
||||
- uses: actions/cache@v4
|
||||
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
|
||||
path: |
|
||||
~/.cache/pip
|
||||
~/.platformio/.cache
|
||||
key: ${{ runner.os }}-pio
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
name: release-assets
|
||||
path: release/
|
||||
|
||||
python-version: '3.9'
|
||||
- name: Install PlatformIO Core
|
||||
run: pip install --upgrade platformio
|
||||
- name: Install ESPTool
|
||||
run: pip install --upgrade esptool
|
||||
- name: Build PlatformIO Project esp32dev
|
||||
run: |
|
||||
pio run --environment esp32dev
|
||||
mkdir -p release/esp32dev
|
||||
cp .pio/build/esp32dev/firmware.bin release/esp32dev/nuki_hub.bin
|
||||
cp .pio/build/esp32dev/partitions.bin release/esp32dev/nuki_hub.partitions.bin
|
||||
cp .pio/build/esp32dev/bootloader.bin release/esp32dev/bootloader.bin
|
||||
esptool.py --chip esp32 merge_bin -o release/esp32dev/nuki_hub_esp32.bin --flash_mode dio --flash_freq keep --flash_size keep 0x1000 release/esp32dev/bootloader.bin 0x10000 release/esp32dev/nuki_hub.bin 0x8000 release/esp32dev/nuki_hub.partitions.bin
|
||||
echo "esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0x1000 bootloader.bin 0x10000 nuki_hub.bin 0x8000 nuki_hub.partitions.bin" > release/esp32dev/flash.sh
|
||||
- name: Build PlatformIO Project esp32-s3
|
||||
run: |
|
||||
pio run --environment esp32-s3
|
||||
mkdir -p release/esp32-s3
|
||||
cp .pio/build/esp32-s3/firmware.bin release/esp32-s3/nuki_hub.bin
|
||||
cp .pio/build/esp32-s3/partitions.bin release/esp32-s3/nuki_hub.partitions.bin
|
||||
cp .pio/build/esp32-s3/bootloader.bin release/esp32-s3/bootloader.bin
|
||||
esptool.py --chip esp32s3 merge_bin -o release/esp32-s3/nuki_hub_esp32s3.bin --flash_mode dio --flash_freq keep --flash_size keep 0x0 release/esp32-s3/bootloader.bin 0x10000 release/esp32-s3/nuki_hub.bin 0x8000 release/esp32-s3/nuki_hub.partitions.bin
|
||||
echo "esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0x0 bootloader.bin 0x10000 nuki_hub.bin 0x8000 nuki_hub.partitions.bin" > release/esp32-s3/flash.sh
|
||||
- name: Build PlatformIO Project esp32-c3
|
||||
run: |
|
||||
pio run --environment esp32-c3
|
||||
mkdir -p release/esp32-c3
|
||||
cp .pio/build/esp32-c3/firmware.bin release/esp32-c3/nuki_hub.bin
|
||||
cp .pio/build/esp32-c3/partitions.bin release/esp32-c3/nuki_hub.partitions.bin
|
||||
cp .pio/build/esp32-c3/bootloader.bin release/esp32-c3/bootloader.bin
|
||||
esptool.py --chip esp32c3 merge_bin -o release/esp32-c3/nuki_hub_esp32c3.bin --flash_mode dio --flash_freq keep --flash_size keep 0x0 release/esp32-c3/bootloader.bin 0x10000 release/esp32-c3/nuki_hub.bin 0x8000 release/esp32-c3/nuki_hub.partitions.bin
|
||||
echo "esptool.py --chip esp32c3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0x0 bootloader.bin 0x10000 nuki_hub.bin 0x8000 nuki_hub.partitions.bin" > release/esp32-c3/flash.sh
|
||||
- name: Build PlatformIO Project esp32solo1
|
||||
run: |
|
||||
pio run --environment esp32solo1
|
||||
mkdir -p release/esp32solo1
|
||||
cp .pio/build/esp32solo1/firmware.bin release/esp32solo1/nuki_hub.bin
|
||||
cp .pio/build/esp32solo1/partitions.bin release/esp32solo1/nuki_hub.partitions.bin
|
||||
cp .pio/build/esp32solo1/bootloader.bin release/esp32solo1/bootloader.bin
|
||||
esptool.py --chip esp32 merge_bin -o release/esp32solo1/nuki_hub_esp32solo1.bin --flash_mode dio --flash_freq keep --flash_size keep 0x1000 release/esp32solo1/bootloader.bin 0x10000 release/esp32solo1/nuki_hub.bin 0x8000 release/esp32solo1/nuki_hub.partitions.bin
|
||||
echo "esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0x1000 bootloader.bin 0x10000 nuki_hub.bin 0x8000 nuki_hub.partitions.bin" > release/esp32solo1/flash.sh
|
||||
- name: Upload Artifact esp32dev
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: esp32dev-assets
|
||||
path: release/esp32dev
|
||||
- name: Upload Artifact esp32-s3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: esp32-s3-assets
|
||||
path: release/esp32-s3
|
||||
- name: Upload Artifact esp32-c3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: esp32-c3-assets
|
||||
path: release/esp32-c3
|
||||
- name: Upload Artifact esp32solo1
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: esp32solo1-assets
|
||||
path: release/esp32solo1
|
||||
Reference in New Issue
Block a user