Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub action to build firmware #178

Open
wants to merge 7 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/build-platformio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build Firmware

on:
push:
paths-ignore:
- 'doc/**'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-platformio-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: pio run -e default
- name: Convert bootloader format from elf to bin
run: >
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 elf2image
--dont-append-digest
~/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.elf
- name: Create merged binary
run: >
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin -o .pio/build/default/firmware-full.bin
--flash_mode dio --flash_freq 40m --flash_size 4MB
0x1000 ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.bin
0x8000 .pio/build/default/partitions.bin
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin
0x10000 .pio/build/default/firmware.bin
- name: Rename binaries
run: |
mv .pio/build/default/firmware.bin .pio/build/default/tinygs-$(git describe --tags --always)-ota.bin
mv .pio/build/default/firmware-full.bin .pio/build/default/tinygs-$(git describe --tags --always)-full.bin
- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
name: firmware
path: |
.pio/build/default/tinygs-*-ota.bin
.pio/build/default/tinygs-*-full.bin
6 changes: 2 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ lib_deps = https://github.com/jgromes/RadioLib/archive/refs/heads/master.zip
;upload_protocol = espota
;upload_port = IP_OF_THE_BOARD



; NOTE: There is no need to change anything below here, the board is configured through the Web panel
; Only make changes if you know what you are doing
[env:heltec_wifi_lora_32]
[env:default]
platform = espressif32 @ 6.3.2
board = heltec_wifi_lora_32
framework = arduino
monitor_speed = 115200
upload_speed = 921600
monitor_port = /dev/ttyUSB*
upload_port = /dev/ttyUSB*
upload_port = /dev/ttyUSB*