fix(esp32): reboot out of a wedged network stack instead of needing a… #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ESP32 firmware release | |
| # On an `esp32-vX.Y.Z` tag: build the ESP32 image and attach it to the GitHub Release. Runs on the | |
| # same self-hosted `sdk-builder` runner as the AmebaZ2 build, reusing its installed ESP-IDF + | |
| # esp-matter (a cold esp-matter bootstrap in a hosted container is slow and fragile). The runner | |
| # must export two paths so none leak into this workflow: | |
| # IDF_EXPORT = <esp-idf>/export.sh (the IDF matching versions.env IDF_PIN) | |
| # ESP_MATTER_EXPORT = <esp-matter>/export.sh | |
| # Tag-push only, so fork PRs can't reach the runner. stage/flash stay manual. | |
| on: | |
| push: | |
| tags: ['esp32-v[0-9]+.[0-9]+.[0-9]+'] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| # GitHub-only: Gitea auto-reads .github/workflows but its runner is labeled `sdk-builder` | |
| # (not `self-hosted`), so this runs-on would never match there. Skip on Gitea. | |
| if: ${{ github.server_url == 'https://github.com' }} | |
| runs-on: [self-hosted, sdk-builder] | |
| defaults: | |
| run: | |
| shell: bash # ESP-IDF export.sh + esp-matter export.sh are bash | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Tag must match CMake PROJECT_VER | |
| run: | | |
| tag_ver="${GITHUB_REF_NAME#esp32-v}" | |
| cmake_ver=$(sed -n 's/^set(PROJECT_VER "\(.*\)").*/\1/p' firmware/esp32-matter/CMakeLists.txt) | |
| [ "$tag_ver" = "$cmake_ver" ] || { echo "::error::tag esp32-v$tag_ver != PROJECT_VER $cmake_ver"; exit 1; } | |
| # Both flavours are published (#22). Separate build dirs so neither clobbers the other, and | |
| # RELEASE is built last so build/ ends up holding the image users should deploy. The version | |
| # int is identical for both by design; the flavour lives in the FILENAME. | |
| - name: Build both flavours (reuse the runner's ESP-IDF + esp-matter) | |
| run: | | |
| : "${IDF_EXPORT:?set IDF_EXPORT on the runner to the esp-idf export.sh path}" | |
| : "${ESP_MATTER_EXPORT:?set ESP_MATTER_EXPORT on the runner to the esp-matter export.sh path}" | |
| # shellcheck disable=SC1090 | |
| . "$IDF_EXPORT" | |
| # shellcheck disable=SC1090 | |
| . "$ESP_MATTER_EXPORT" | |
| cd firmware/esp32-matter | |
| idf.py set-target esp32 | |
| idf.py -B build.debug -DSDKCONFIG=sdkconfig.ci.debug \ | |
| -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug" build | |
| idf.py build | |
| - name: Collect artifacts + checksums | |
| run: | | |
| # #89: ESP-IDF builds are not byte-reproducible, so this rebuild is NOT the deployed | |
| # image. Critically, delta OTA verifies the BASE image's hash, so a patch built against | |
| # this file is rejected by the device. The valid delta base is uploaded under the | |
| # canonical name by `esp32-release.sh publish` from the box that flashed the node. | |
| cd firmware/esp32-matter | |
| cp build.debug/hisense_ac_matter.bin build/hisense_ac_matter-debug-CI-REBUILD.bin | |
| mv build/hisense_ac_matter.bin build/hisense_ac_matter-CI-REBUILD.bin | |
| cd build | |
| sha256sum hisense_ac_matter-CI-REBUILD.bin hisense_ac_matter-debug-CI-REBUILD.bin bootloader/bootloader.bin \ | |
| partition_table/partition-table.bin ota_data_initial.bin flasher_args.json > SHA256SUMS.txt | |
| - name: Attach to the GitHub Release | |
| uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2 | |
| with: | |
| generate_release_notes: true # auto "What's Changed" from commits/PRs since the last tag | |
| files: | | |
| firmware/esp32-matter/build/hisense_ac_matter-CI-REBUILD.bin | |
| firmware/esp32-matter/build/hisense_ac_matter-debug-CI-REBUILD.bin | |
| firmware/esp32-matter/build/bootloader/bootloader.bin | |
| firmware/esp32-matter/build/partition_table/partition-table.bin | |
| firmware/esp32-matter/build/ota_data_initial.bin | |
| firmware/esp32-matter/build/flasher_args.json | |
| firmware/esp32-matter/build/SHA256SUMS.txt |