Build ESP-Hosted Firmware #6
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: Build ESP-Hosted Firmware | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| release: | |
| description: 'Create a release' | |
| type: boolean | |
| default: true | |
| env: | |
| ESP_IDF_VERSION: v5.5.1 | |
| ESP_HOSTED_VERSION: "2.7.0" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: espressif/idf:v5.5.1 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - esp32 | |
| - esp32c5 | |
| - esp32c6 | |
| - esp32c61 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create project from esp_hosted slave example | |
| run: | | |
| . $IDF_PATH/export.sh | |
| idf.py create-project-from-example "espressif/esp_hosted^${{ env.ESP_HOSTED_VERSION }}:slave" | |
| - name: Build firmware | |
| working-directory: slave | |
| run: | | |
| . $IDF_PATH/export.sh | |
| idf.py set-target ${{ matrix.target }} | |
| idf.py build | |
| - name: Prepare artifacts | |
| run: | | |
| mkdir -p artifacts/${{ env.ESP_HOSTED_VERSION }} | |
| cp slave/build/network_adapter.bin artifacts/${{ env.ESP_HOSTED_VERSION }}/network_adapter_${{ matrix.target }}.bin | |
| sha256sum artifacts/${{ env.ESP_HOSTED_VERSION }}/network_adapter_${{ matrix.target }}.bin > artifacts/${{ env.ESP_HOSTED_VERSION }}/network_adapter_${{ matrix.target }}.bin.sha256 | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firmware-${{ matrix.target }} | |
| path: artifacts/ | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') || inputs.release | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: firmware | |
| merge-multiple: true | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ env.ESP_HOSTED_VERSION }} | |
| files: firmware/**/* | |
| generate_release_notes: true |