Build Firmware #3
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 Firmware | |
| on: | |
| workflow_dispatch: | |
| # push: | |
| # branches: | |
| # - main | |
| # pull_request: | |
| # branches: | |
| # - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y make python3 yq unzip wget gcc-arm-none-eabi | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Cache Silicon Labs Tools | |
| uses: actions/cache@v3 | |
| with: | |
| path: silabs_tools | |
| key: silabs-tools-2025.6.2 | |
| - name: Cache Telink Tools | |
| uses: actions/cache@v3 | |
| with: | |
| path: telink_tools | |
| key: telink-tools-v3.7.2.0 | |
| - name: Cache Python Virtual Environment | |
| uses: actions/cache@v3 | |
| with: | |
| path: .venv | |
| key: python-venv-${{ hashFiles('requirements.txt') }} | |
| - name: Install SDK and Toolchain | |
| run: | | |
| make setup || ( | |
| echo "dumping log:" && | |
| cat /home/runner/work/tuya-zigbee-switch/tuya-zigbee-switch/silabs_tools/slc-cli/bin/slc-cli/configuration/*.log | |
| ) | |
| - name: Clear out index files | |
| run: | | |
| source .venv/bin/activate | |
| make tools/clean_z2m_index | |
| - name: Build for all boards | |
| run: | | |
| source .venv/bin/activate | |
| yq -r 'to_entries | sort_by(.key)[] | "\(.key) \(.value.device_type) \(.value.build)"' device_db.yaml | while read ITER TYPE BUILD; do | |
| if [ "$BUILD" = "no" ]; then | |
| echo "Skipping $ITER as building this model is disabled in the db." | |
| continue | |
| fi | |
| echo "Building for board: $ITER (router)" | |
| BOARD=$ITER DEVICE_TYPE=router make board/build || exit 1 | |
| echo "Checking if files were created for board: $ITER (router)" | |
| ls -l bin/router/$ITER/ | |
| if [ "$TYPE" = "end_device" ]; then | |
| echo "Building for board: $ITER (end_device)" | |
| BOARD=${ITER} DEVICE_TYPE=end_device make board/build || exit 1 | |
| echo "Checking if files were created for board: $ITER (end_device)" | |
| ls -l bin/end_device/${ITER}_END_DEVICE/ | |
| fi | |
| done | |
| - name: Update Z2M converters | |
| run: | | |
| source .venv/bin/activate | |
| make tools/update_converters | |
| - name: Update ZHA quirks | |
| run: | | |
| source .venv/bin/activate | |
| make tools/update_zha_quirk | |
| - name: Update HOMEd extensions | |
| run: | | |
| source .venv/bin/activate | |
| make tools/update_homed_extension | |
| - name: Update supported_devices.md | |
| run: | | |
| source .venv/bin/activate | |
| make tools/update_supported_devices | |
| - name: Commit changes | |
| run: | | |
| source .venv/bin/activate | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| git add bin/* zigbee2mqtt/* zha/* homed/* docs/supported_devices.md | |
| git diff --cached --quiet || git commit -m "Update firmware files, converters, quirks, extensions and supported devices list" | |
| make tools/freeze_ota_links | |
| git add zigbee2mqtt/* | |
| git diff --cached --quiet || git commit -m "Freeze links in OTA index files" | |
| git push |