mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-03-30 08:52:11 +02:00
86 lines
2.6 KiB
YAML
86 lines
2.6 KiB
YAML
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:
|
|
include:
|
|
- env: esp32dev
|
|
name: ESP32
|
|
chip: ESP32
|
|
addr_bootloader: "0x1000"
|
|
fwname: SomfyController.esp32.bin
|
|
obname: SomfyController.onboard.esp32.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: 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: 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 \
|
|
0x310000 .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: SomfyController.littlefs.bin
|
|
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
|