From 7c19828e91874f73115cbd861480596c0d40681c Mon Sep 17 00:00:00 2001 From: Assaf Inbal Date: Fri, 11 Oct 2024 10:47:04 +0300 Subject: [PATCH] Release builds for other ESP32 variants Closes #204 --- .github/workflows/main.yml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c020b94..2ff2ede 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,12 +6,20 @@ on: pull_request: branches: [ master ] release: - types: [ published ] + types: [ created ] workflow_dispatch: jobs: build: runs-on: ubuntu-latest + permissions: + contents: write + strategy: + matrix: + esp-variant: + - esp32 + - esp32-s3 + - esp32-c3 steps: - name: Checkout uses: actions/checkout@v3 @@ -22,22 +30,34 @@ jobs: uses: espressif/esp-idf-ci-action@v1.1.0 with: esp_idf_version: v5.2.1 - command: idf.py image + command: | + idf.py set-target ${{ matrix.esp-variant }} + idf.py image - name: Upload Application Image uses: actions/upload-artifact@v4 with: - name: Application + name: Application (${{ matrix.esp-variant }}) path: build/ble2mqtt.bin - name: Upload Filesystem Image uses: actions/upload-artifact@v4 with: - name: File System + name: File System (${{ matrix.esp-variant }}) path: build/fs_0.bin - name: Upload Full Flash Image uses: actions/upload-artifact@v4 with: - name: Full Flash Image + name: Full Flash Image (${{ matrix.esp-variant }}) path: build/ble2mqtt-full.bin + + - name: Upload Release + if: github.event_name == 'release' && github.event.action == 'created' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cp build/ble2mqtt-full.bin build/ble2mqtt-full.${{ matrix.esp-variant }}.bin + cp build/ble2mqtt.bin build/ble2mqtt.${{ matrix.esp-variant }}.bin + gh release upload ${GITHUB_REF#refs/tags/} build/ble2mqtt-full.${{ matrix.esp-variant }}.bin + gh release upload ${GITHUB_REF#refs/tags/} build/ble2mqtt.${{ matrix.esp-variant }}.bin