Build Firmware #28
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 python3-jinja2 python3-yaml yq unzip wget | |
| - name: Install SDK and Toolchain | |
| run: | | |
| make install | |
| - name: Clear out index files | |
| run: | | |
| echo [] > zigbee2mqtt/ota/index_router.json | |
| echo [] > zigbee2mqtt/ota/index_end_device.json | |
| echo [] > zigbee2mqtt/ota/index_router-FORCE.json | |
| echo [] > zigbee2mqtt/ota/index_end_device-FORCE.json | |
| - name: Build for all boards | |
| run: | | |
| 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 clean && BOARD=$ITER DEVICE_TYPE=router make -j16 || 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 clean && BOARD=${ITER} DEVICE_TYPE=end_device make -j16 || 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: | | |
| make update_converters | |
| - name: Update ZHA quirks | |
| run: | | |
| make update_zha_quirk | |
| - name: Update supported_devices.md | |
| run: | | |
| make update_supported_devices | |
| - name: Commit changes | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "[email protected]" | |
| git add bin/* zigbee2mqtt/* zha/* docs/devices/supported.md | |
| git diff --cached --quiet || git commit -m "Update firmware files, converters, quirks and supported devices list" | |
| make freeze_ota_links | |
| git add zigbee2mqtt/* | |
| git diff --cached --quiet || git commit -m "Freeze links in OTA index files" | |
| git push |