183 lines
10 KiB
YAML
183 lines
10 KiB
YAML
name: NukiHub
|
|
on:
|
|
push:
|
|
branches: ["*"]
|
|
tags: ["*"]
|
|
pull_request:
|
|
branches: ["*"]
|
|
tags: ["*"]
|
|
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
name: Checkout source code and build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/pip
|
|
~/.platformio/.cache
|
|
key: ${{ runner.os }}-pio
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
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_esp32.bin
|
|
cp .pio/build/esp32dev/partitions.bin release/esp32dev/nuki_hub.partitions.bin
|
|
cp .pio/build/esp32dev/bootloader.bin release/esp32dev/bootloader.bin
|
|
cp bin/boot_app0.bin release/esp32dev/boot_app0.bin
|
|
esptool.py --chip esp32 merge_bin -o release/esp32dev/webflash_nuki_hub_esp32.bin --flash_mode dio --flash_freq keep --flash_size keep 0xe000 bin/boot_app0.bin 0x1000 release/esp32dev/bootloader.bin 0x10000 release/esp32dev/nuki_hub_esp32.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 0xe000 bin/boot_app0.bin 0x1000 bootloader.bin 0x10000 nuki_hub_esp32.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/esp32s3
|
|
cp .pio/build/esp32-s3/firmware.bin release/esp32s3/nuki_hub_esp32s3.bin
|
|
cp .pio/build/esp32-s3/partitions.bin release/esp32s3/nuki_hub.partitions.bin
|
|
cp .pio/build/esp32-s3/bootloader.bin release/esp32s3/bootloader.bin
|
|
cp bin/boot_app0.bin release/esp32s3/boot_app0.bin
|
|
esptool.py --chip esp32s3 merge_bin -o release/esp32s3/webflash_nuki_hub_esp32s3.bin --flash_mode dio --flash_freq keep --flash_size keep 0xe000 bin/boot_app0.bin 0x0 release/esp32s3/bootloader.bin 0x10000 release/esp32s3/nuki_hub_esp32s3.bin 0x8000 release/esp32s3/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 0xe000 bin/boot_app0.bin 0x0 bootloader.bin 0x10000 nuki_hub_esp32s3.bin 0x8000 nuki_hub.partitions.bin" > release/esp32s3/flash.sh
|
|
- name: Build PlatformIO Project esp32-c3
|
|
run: |
|
|
pio run --environment esp32-c3
|
|
mkdir -p release/esp32c3
|
|
cp .pio/build/esp32-c3/firmware.bin release/esp32c3/nuki_hub_esp32c3.bin
|
|
cp .pio/build/esp32-c3/partitions.bin release/esp32c3/nuki_hub.partitions.bin
|
|
cp .pio/build/esp32-c3/bootloader.bin release/esp32c3/bootloader.bin
|
|
cp bin/boot_app0.bin release/esp32c3/boot_app0.bin
|
|
esptool.py --chip esp32c3 merge_bin -o release/esp32c3/webflash_nuki_hub_esp32c3.bin --flash_mode dio --flash_freq keep --flash_size keep 0xe000 bin/boot_app0.bin 0x0 release/esp32c3/bootloader.bin 0x10000 release/esp32c3/nuki_hub_esp32c3.bin 0x8000 release/esp32c3/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 0xe000 bin/boot_app0.bin 0x0 bootloader.bin 0x10000 nuki_hub_esp32c3.bin 0x8000 nuki_hub.partitions.bin" > release/esp32c3/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_esp32solo1.bin
|
|
cp .pio/build/esp32solo1/partitions.bin release/esp32solo1/nuki_hub.partitions.bin
|
|
cp .pio/build/esp32solo1/bootloader.bin release/esp32solo1/bootloader.bin
|
|
cp bin/boot_app0.bin release/esp32solo1/boot_app0.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 0xe000 bin/boot_app0.bin 0x1000 bootloader.bin 0x10000 nuki_hub_esp32solo1.bin 0x8000 nuki_hub.partitions.bin" > release/esp32solo1/flash.sh
|
|
- name: Upload Artifact esp32dev
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: esp32-assets
|
|
path: release/esp32dev
|
|
- name: Upload Artifact esp32-s3
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: esp32-s3-assets
|
|
path: release/esp32s3
|
|
- name: Upload Artifact esp32-c3
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: esp32-c3-assets
|
|
path: release/esp32c3
|
|
- name: Upload Artifact esp32solo1
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: esp32solo1-assets
|
|
path: release/esp32solo1
|
|
- name: Build PlatformIO Project esp32dev_dbg
|
|
run: |
|
|
pio run --environment esp32dev_dbg
|
|
mkdir -p debug/esp32dev
|
|
cp .pio/build/esp32dev_dbg/bootloader.bin debug/esp32dev/bootloader.bin
|
|
cp .pio/build/esp32dev_dbg/firmware.bin debug/esp32dev/nuki_hub_esp32.bin
|
|
cp .pio/build/esp32dev_dbg/partitions.bin debug/esp32dev/nuki_hub.partitions.bin
|
|
cp .pio/build/esp32dev_dbg/firmware.elf debug/esp32dev/nuki_hub_esp32.elf
|
|
cp bin/boot_app0.bin debug/esp32dev/boot_app0.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 0xe000 bin/boot_app0.bin 0x1000 bootloader.bin 0x10000 nuki_hub_esp32.bin 0x8000 nuki_hub.partitions.bin" > debug/esp32dev/flash.sh
|
|
- name: Build PlatformIO Project esp32-s3_dbg
|
|
run: |
|
|
pio run --environment esp32-s3_dbg
|
|
mkdir -p debug/esp32s3
|
|
cp .pio/build/esp32-s3_dbg/bootloader.bin debug/esp32s3/bootloader.bin
|
|
cp .pio/build/esp32-s3_dbg/firmware.bin debug/esp32s3/nuki_hub_esp32s3.bin
|
|
cp .pio/build/esp32-s3_dbg/partitions.bin debug/esp32s3/nuki_hub.partitions.bin
|
|
cp .pio/build/esp32-s3_dbg/firmware.elf debug/esp32s3/nuki_hub_esp32s3.elf
|
|
cp bin/boot_app0.bin debug/esp32s3/boot_app0.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 0xe000 bin/boot_app0.bin 0x0 bootloader.bin 0x10000 nuki_hub_esp32s3.bin 0x8000 nuki_hub.partitions.bin" > debug/esp32s3/flash.sh
|
|
- name: Build PlatformIO Project esp32-c3_dbg
|
|
run: |
|
|
pio run --environment esp32-c3_dbg
|
|
mkdir -p debug/esp32c3
|
|
cp .pio/build/esp32-c3_dbg/bootloader.bin debug/esp32c3/bootloader.bin
|
|
cp .pio/build/esp32-c3_dbg/firmware.bin debug/esp32c3/nuki_hub_esp32c3.bin
|
|
cp .pio/build/esp32-c3_dbg/partitions.bin debug/esp32c3/nuki_hub.partitions.bin
|
|
cp .pio/build/esp32-c3_dbg/firmware.elf debug/esp32c3/nuki_hub_esp32c3.elf
|
|
cp bin/boot_app0.bin debug/esp32c3/boot_app0.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 0xe000 bin/boot_app0.bin 0x0 bootloader.bin 0x10000 nuki_hub_esp32c3.bin 0x8000 nuki_hub.partitions.bin" > debug/esp32c3/flash.sh
|
|
- name: Build PlatformIO Project esp32solo1_dbg
|
|
run: |
|
|
pio run --environment esp32solo1_dbg
|
|
mkdir -p debug/esp32solo1
|
|
cp .pio/build/esp32solo1_dbg/bootloader.bin debug/esp32solo1/bootloader.bin
|
|
cp .pio/build/esp32solo1_dbg/firmware.bin debug/esp32solo1/nuki_hub_esp32solo1.bin
|
|
cp .pio/build/esp32solo1_dbg/partitions.bin debug/esp32solo1/nuki_hub.partitions.bin
|
|
cp .pio/build/esp32solo1_dbg/firmware.elf debug/esp32solo1/nuki_hub_esp32solo1.elf
|
|
cp bin/boot_app0.bin debug/esp32solo1/boot_app0.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 0xe000 bin/boot_app0.bin 0x1000 bootloader.bin 0x10000 nuki_hub_esp32solo1.bin 0x8000 nuki_hub.partitions.bin" > debug/esp32solo1/flash.sh
|
|
- name: Upload Artifact esp32dev-debug
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: esp32-debug-assets
|
|
path: debug/esp32dev
|
|
- name: Upload Artifact esp32-s3-debug
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: esp32-s3-debug-assets
|
|
path: debug/esp32s3
|
|
- name: Upload Artifact esp32-c3-debug
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: esp32-c3-debug-assets
|
|
path: debug/esp32c3
|
|
- name: Upload Artifact esp32solo1-debug
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: esp32solo1-debug-assets
|
|
path: debug/esp32solo1
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags')
|
|
steps:
|
|
- name: Download esp32dev-debug
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: esp32-debug-assets
|
|
path: debug/esp32dev
|
|
|
|
- name: Get the version
|
|
id: get_version
|
|
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build the zip archive from the documentation
|
|
run: |
|
|
cd debug/esp32dev
|
|
zip -9r ../NukiHub-${{ steps.get_version.outputs.VERSION }}-ESP32-DEBUG.zip *
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
prerelease: false
|
|
draft: true
|
|
artifacts: "NukiHub-${{ steps.get_version.outputs.VERSION }}-ESP32-DEBUG.zip"
|
|
artifactContentType: application/zip |