mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-04-20 11:02:14 +02:00
improve release build
This commit is contained in:
parent
9bcf2eb3f5
commit
15d5b064d4
2 changed files with 36 additions and 57 deletions
129
.github/workflows/release.yaml
vendored
129
.github/workflows/release.yaml
vendored
|
|
@ -1,129 +0,0 @@
|
|||
name: ESPSomfy-RTS Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions: write-all
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# fwname: firmware-only binary for OTA updates
|
||||
# obname: onboard image (bootloader + partitions + firmware + littlefs merged)
|
||||
# for flashing a new chip via USB/serial
|
||||
# addr_bootloader: chip-dependent (ESP32: 0x1000, C3/S3: 0x0)
|
||||
# addr_fs: must match spiffs/littlefs offset in esp32_3MB.csv
|
||||
include:
|
||||
- env: esp32dev
|
||||
name: ESP32
|
||||
chip: ESP32
|
||||
addr_bootloader: "0x1000"
|
||||
addr_fs: "0x310000"
|
||||
fwname: SomfyController.ino.esp32.bin
|
||||
fsname: SomfyController.littlefs.esp32.bin
|
||||
obname: SomfyController.onboard.esp32.bin
|
||||
- env: esp32c3
|
||||
name: ESP32-C3
|
||||
chip: ESP32-C3
|
||||
addr_bootloader: "0x0"
|
||||
addr_fs: "0x310000"
|
||||
fwname: SomfyController.ino.esp32c3.bin
|
||||
fsname: SomfyController.littlefs.esp32c3.bin
|
||||
obname: SomfyController.onboard.esp32c3.bin
|
||||
- env: esp32s3
|
||||
name: ESP32-S3
|
||||
chip: ESP32-S3
|
||||
addr_bootloader: "0x0"
|
||||
addr_fs: "0x670000"
|
||||
fwname: SomfyController.ino.esp32s3.bin
|
||||
fsname: SomfyController.littlefs.esp32s3.bin
|
||||
obname: SomfyController.onboard.esp32s3.bin
|
||||
- env: esp32c6
|
||||
name: ESP32-C6
|
||||
chip: ESP32-C6
|
||||
addr_bootloader: "0x0"
|
||||
addr_fs: "0x310000"
|
||||
fwname: SomfyController.ino.esp32c6.bin
|
||||
fsname: SomfyController.littlefs.esp32c6.bin
|
||||
obname: SomfyController.onboard.esp32c6.bin
|
||||
|
||||
steps:
|
||||
- name: Get Release
|
||||
id: get_release
|
||||
uses: bruceadams/get-release@v1.3.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Update version from release tag
|
||||
run: |
|
||||
VERSION="${{ github.event.release.tag_name }}"
|
||||
VERSION="${VERSION#v}"
|
||||
sed -i "s/#define FW_VERSION \"v[0-9.]*\"/#define FW_VERSION \"v${VERSION}\"/" src/ConfigSettings.h
|
||||
sed -i "s/^[0-9.].*/${VERSION}/" data-src/appversion
|
||||
sed -i "s/\?v=[0-9.]*c/?v=${VERSION}c/g" data-src/index.html
|
||||
sed -i "s/appVersion = 'v[0-9.]*'/appVersion = 'v${VERSION}'/" data-src/index.js
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install PlatformIO and esptool
|
||||
run: pip install platformio esptool
|
||||
|
||||
- name: Build firmware
|
||||
run: pio run -e ${{ matrix.env }}
|
||||
|
||||
- name: Build LittleFS image
|
||||
run: pio run -e ${{ matrix.env }} -t buildfs
|
||||
|
||||
- name: List build artifacts
|
||||
run: ls -la .pio/build/${{ matrix.env }}/
|
||||
|
||||
- name: Create onboard image
|
||||
run: |
|
||||
python -m esptool --chip ${{ matrix.chip }} \
|
||||
merge-bin -o ${{ matrix.obname }} \
|
||||
${{ matrix.addr_bootloader }} .pio/build/${{ matrix.env }}/bootloader.bin \
|
||||
0x8000 .pio/build/${{ matrix.env }}/partitions.bin \
|
||||
0x10000 .pio/build/${{ matrix.env }}/firmware.bin \
|
||||
${{ matrix.addr_fs }} .pio/build/${{ matrix.env }}/littlefs.bin
|
||||
|
||||
- name: Compress onboard image
|
||||
run: zip ${{ matrix.obname }}.zip ${{ matrix.obname }}
|
||||
|
||||
- name: Upload LittleFS
|
||||
uses: shogo82148/actions-upload-release-asset@v1.7.5
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_name: ${{ matrix.fsname }}
|
||||
asset_path: .pio/build/${{ matrix.env }}/littlefs.bin
|
||||
overwrite: true
|
||||
|
||||
- name: Upload firmware
|
||||
uses: shogo82148/actions-upload-release-asset@v1.7.5
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_name: ${{ matrix.fwname }}
|
||||
asset_path: .pio/build/${{ matrix.env }}/firmware.bin
|
||||
overwrite: true
|
||||
|
||||
- name: Upload onboard image
|
||||
uses: shogo82148/actions-upload-release-asset@v1.7.5
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||
asset_name: ${{ matrix.obname }}.zip
|
||||
asset_path: ${{ matrix.obname }}.zip
|
||||
overwrite: true
|
||||
asset_content_type: application/zip
|
||||
Loading…
Add table
Add a link
Reference in a new issue