# Copyright 2022 Espressif Systems (Shanghai) PTE LTD # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This workflow build examples, store the artifacts and deploy them to github pages. # Generates the launchpad configuration file that can be used with the url. name: "Build binaries and deploy to GitHub Pages" on: workflow_dispatch: push: branches: - master # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write # Allow one concurrent deployment concurrency: group: "pages" cancel-in-progress: true jobs: build-speaker: name: "Build Speaker" runs-on: ubuntu-latest container: espressif/idf:release-v5.5 steps: - uses: actions/checkout@v3 with: submodules: 'recursive' - run: mkdir -p images/speaker - name: Get product version shell: bash run: | PRODUCT_VERSION=$(.github/tools/get_example_version.sh products/speaker) echo "PRODUCT_VERSION=$PRODUCT_VERSION" >> $GITHUB_ENV echo "Product version: $PRODUCT_VERSION" - name: Get boards name shell: bash run: | BOARDS_NAME=$(.github/tools/get_boards_name.sh products/speaker) echo "BOARDS_NAME=$BOARDS_NAME" >> $GITHUB_ENV echo "All boards name: $BOARDS_NAME" - name: Build product shell: bash run: | cd products/speaker . ${IDF_PATH}/export.sh for board in $BOARDS_NAME; do idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.ci.board.${board}" set-target esp32s3 && idf.py build pushd build esptool.py --chip esp32s3 merge_bin -o "$GITHUB_WORKSPACE/images/speaker/speaker_${PRODUCT_VERSION}_${board}.bin" @flash_args popd rm -rf sdkconfig build managed_components dependencies.lock done - name: Upload artifact uses: actions/upload-artifact@v4 with: name: build-images-speaker path: images/speaker/ overwrite: true build-service-console: name: "Build Service Console" runs-on: ubuntu-latest container: espressif/idf:release-v5.5 strategy: fail-fast: false matrix: board: - esp_vocat_board_v1_0 - esp_vocat_board_v1_2 - esp_box_3 - esp32_p4_function_ev - esp32_s3_korvo2_v3 - esp_sensair_shuttle steps: - uses: actions/checkout@v3 with: submodules: 'recursive' - run: mkdir -p images/service_console - name: Get board chip type shell: bash run: | CHIP=$(grep "^chip:" examples/service_console/boards/${{ matrix.board }}/board_info.yaml | awk '{print $2}') echo "CHIP=$CHIP" >> $GITHUB_ENV echo "Board chip: $CHIP" - name: Build service_console for ${{ matrix.board }} shell: bash run: | . ${IDF_PATH}/export.sh $GITHUB_WORKSPACE/.github/tools/build_with_board_manager.sh \ -p examples/service_console \ -b ${{ matrix.board }} \ -c $CHIP \ -o $GITHUB_WORKSPACE/images/service_console \ - name: Upload artifact uses: actions/upload-artifact@v4 with: name: build-images-service-console-${{ matrix.board }} path: images/service_console/ overwrite: true deploy: needs: [build-speaker, build-service-console] environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: 'recursive' - name: Create directory structure run: | mkdir -p images/speaker mkdir -p images/service_console - name: Download speaker builds uses: actions/download-artifact@v4 with: name: build-images-speaker path: images/speaker/ - name: Download service_console builds uses: actions/download-artifact@v4 with: pattern: build-images-service-console-* path: images/service_console/ merge-multiple: true - name: Generate launchpad configs run: | # Generate speaker launchpad cd $GITHUB_WORKSPACE/images/speaker/ ls -la $GITHUB_WORKSPACE/.github/tools/generate_launchpad_config.sh $GITHUB_REPOSITORY speaker # Generate service_console launchpad cd $GITHUB_WORKSPACE/images/service_console/ ls -la $GITHUB_WORKSPACE/.github/tools/generate_launchpad_config.sh $GITHUB_REPOSITORY service_console - name: Generate index page run: | $GITHUB_WORKSPACE/.github/tools/generate_launchpad_index.sh $GITHUB_REPOSITORY $GITHUB_WORKSPACE/images - name: Setup Pages uses: actions/configure-pages@v2 - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: images/ - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4