Skip to content

Build firmware and release #37

Build firmware and release

Build firmware and release #37

Workflow file for this run

name: Build firmware and release
on:
workflow_dispatch:
inputs:
tag:
description: "Firmare version (Tag)"
required: true
default: '*.*.*'
jobs:
release:
runs-on: ubuntu-latest
env:
TMPDIR: /tmp
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Run PlatformIO build on selected platforms
run: |
pio run -e esp32doit-devkit-v1 -e ttgo-t-eight -e ttgo-t-display -e lilygo-t-display -e heltec_wifi_kit_32 -e esp-wrover-kit -e bpi-leaf-s3 -e lilygo-t-display-s3
pio run -t buildfs -e esp32doit-devkit-v1 -e ttgo-t-eight -e ttgo-t-display -e lilygo-t-display -e heltec_wifi_kit_32 -e esp-wrover-kit -e bpi-leaf-s3 -e lilygo-t-display-s3
- name: Copy binary files
run: |
rm -rf ./firmware/esp32doit-devkit-v1/*
echo ${{ github.event.inputs.tag }} > ./firmware/esp32doit-devkit-v1/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/esp32doit-devkit-v1/esp32doit-devkit-v1-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/esp32doit-devkit-v1/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/esp32doit-devkit-v1/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/esp32doit-devkit-v1/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/esp32doit-devkit-v1/esp32doit-devkit-v1-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/esp32doit-devkit-v1/esp32doit-devkit-v1-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/esp32doit-devkit-v1/g' ./firmware/esp32doit-devkit-v1/esp32doit-devkit-v1-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/esp32doit-devkit-v1/firmware.bin | head -c 32 > ./firmware/esp32doit-devkit-v1/firmware.bin.md5
rm -rf ./firmware/ttgo-t-eight/*
echo ${{ github.event.inputs.tag }} > ./firmware/ttgo-t-eight/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/ttgo-t-eight/ttgo-t-eight-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/ttgo-t-eight/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/ttgo-t-eight/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/ttgo-t-eight/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/ttgo-t-eight/ttgo-t-eight-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/ttgo-t-eight/ttgo-t-eight-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/ttgo-t-eight/g' ./firmware/ttgo-t-eight/ttgo-t-eight-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/ttgo-t-eight/firmware.bin | head -c 32 > ./firmware/ttgo-t-eight/firmware.bin.md5
rm -rf ./firmware/ttgo-t-display/*
echo ${{ github.event.inputs.tag }} > ./firmware/ttgo-t-display/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/ttgo-t-display/ttgo-t-display-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/ttgo-t-display/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/ttgo-t-display/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/ttgo-t-display/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/ttgo-t-display/ttgo-t-display-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/ttgo-t-display/ttgo-t-display-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/ttgo-t-display/g' ./firmware/ttgo-t-display/ttgo-t-display-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/ttgo-t-display/firmware.bin | head -c 32 > ./firmware/ttgo-t-display/firmware.bin.md5
rm -rf ./firmware/lilygo-t-display/*
echo ${{ github.event.inputs.tag }} > ./firmware/lilygo-t-display/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/lilygo-t-display/lilygo-t-display-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/lilygo-t-display/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/lilygo-t-display/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/lilygo-t-display/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/lilygo-t-display/lilygo-t-display-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/lilygo-t-display/lilygo-t-display-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/lilygo-t-display/g' ./firmware/lilygo-t-display/lilygo-t-display-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/lilygo-t-display/firmware.bin | head -c 32 > ./firmware/lilygo-t-display/firmware.bin.md5
rm -rf ./firmware/heltec_wifi_kit_32/*
echo ${{ github.event.inputs.tag }} > ./firmware/heltec_wifi_kit_32/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/heltec_wifi_kit_32/heltec_wifi_kit_32-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/heltec_wifi_kit_32/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/heltec_wifi_kit_32/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/heltec_wifi_kit_32/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/heltec_wifi_kit_32/heltec_wifi_kit_32-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/heltec_wifi_kit_32/heltec_wifi_kit_32-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/heltec_wifi_kit_32/g' ./firmware/heltec_wifi_kit_32/heltec_wifi_kit_32-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/heltec_wifi_kit_32/firmware.bin | head -c 32 > ./firmware/heltec_wifi_kit_32/firmware.bin.md5
rm -rf ./firmware/esp-wrover-kit/*
echo ${{ github.event.inputs.tag }} > ./firmware/esp-wrover-kit/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/esp-wrover-kit/esp-wrover-kit-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/esp-wrover-kit/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/esp-wrover-kit/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/esp-wrover-kit/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/esp-wrover-kit/esp-wrover-kit-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/esp-wrover-kit/esp-wrover-kit-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/esp-wrover-kit/g' ./firmware/esp-wrover-kit/esp-wrover-kit-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/esp-wrover-kit/firmware.bin | head -c 32 > ./firmware/esp-wrover-kit/firmware.bin.md5
rm -rf ./firmware/bpi-leaf-s3/*
echo ${{ github.event.inputs.tag }} > ./firmware/bpi-leaf-s3/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32s3 merge_bin \
-o ./firmware/bpi-leaf-s3/bpi-leaf-s3-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 8MB \
0x0000 /tmp/PedalinoMini/build/bpi-leaf-s3/bootloader.bin \
0x8000 /tmp/PedalinoMini/build/bpi-leaf-s3/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/bpi-leaf-s3/firmware.bin \
0x6e0000 /tmp/PedalinoMini/build/bpi-leaf-s3/spiffs.bin
cp ./manifest/template_esp32s3.json ./firmware/bpi-leaf-s3/bpi-leaf-s3-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/bpi-leaf-s3/bpi-leaf-s3-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/bpi-leaf-s3/g' ./firmware/bpi-leaf-s3/bpi-leaf-s3-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/bpi-leaf-s3/firmware.bin | head -c 32 > ./firmware/bpi-leaf-s3/firmware.bin.md5
rm -rf ./firmware/lilygo-t-display-s3/*
echo ${{ github.event.inputs.tag }} > ./firmware/lilygo-t-display-s3/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32s3 merge_bin \
-o ./firmware/lilygo-t-display-s3/lilygo-t-display-s3-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 16MB \
0x0000 /tmp/PedalinoMini/build/lilygo-t-display-s3/bootloader.bin \
0x8000 /tmp/PedalinoMini/build/lilygo-t-display-s3/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/lilygo-t-display-s3/firmware.bin \
0x6e0000 /tmp/PedalinoMini/build/lilygo-t-display-s3/spiffs.bin
cp ./manifest/template_esp32s3.json ./firmware/lilygo-t-display-s3/lilygo-t-display-s3-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/lilygo-t-display-s3/lilygo-t-display-s3-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/lilygo-t-display-s3/g' ./firmware/lilygo-t-display-s3/lilygo-t-display-s3-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/lilygo-t-display-s3/firmware.bin | head -c 32 > ./firmware/lilygo-t-display-s3/firmware.bin.md5
- name: Commit and push firmware ${{ github.event.inputs.tag }} files
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Release firmware ${{ github.event.inputs.tag }}"
git push origin HEAD:master
git tag ${{ github.event.inputs.tag }}
git push --tags
- name: Create release ${{ github.event.inputs.tag }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}