Build firmwares #226
This file contains 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: Silicon Labs firmware build | |
on: | |
push: | |
paths: | |
- Dockerfile | |
- .github/workflows/build.yaml | |
- .github/workflows/silabs-firmware-build.yaml | |
- EmberZNet/** | |
- OpenThreadRCP/** | |
- RCPMultiPAN/** | |
branches: | |
- main | |
tags: | |
- '*' | |
workflow_dispatch: | |
env: | |
sdk_version: 4.4.1 | |
jobs: | |
build-container: | |
name: Create build container image | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
outputs: | |
sdk_version: ${{ env.sdk_version }} | |
ot_version: 2.4.1.0 | |
ezsp_version: 7.4.1.0 | |
steps: | |
- uses: actions/checkout@v3.3.0 | |
- name: Log in to the GitHub container registry | |
uses: docker/login-action@v2.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2.2.1 | |
- name: Build and Push | |
uses: docker/build-push-action@v5.1.0 | |
with: | |
context: . | |
file: Dockerfile | |
tags: ghcr.io/${{ github.repository }}:${{ env.sdk_version }} | |
cache-from: ghcr.io/${{ github.repository }}:cache-${{ env.sdk_version }} | |
cache-to: ghcr.io/${{ github.repository }}:cache-${{ env.sdk_version }} | |
push: true | |
build-args: | |
"GECKO_SDK_VERSION=v${{ env.sdk_version }}" | |
build-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
ncp_matrix: ${{ steps.process.outputs.ncp_matrix }} | |
rcp_matrix: ${{ steps.process.outputs.rcp_matrix }} | |
ot_matrix: ${{ steps.process.outputs.ot_matrix }} | |
targets: ${{ steps.process.outputs.targets }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Process manifests | |
id: process | |
uses: ./.github/actions/manifest | |
ezsp-firmware-build: | |
name: EmberZNet NCP | |
needs: [build-container, build-matrix] | |
strategy: | |
matrix: | |
target: ${{ fromJson(needs.build-matrix.outputs.targets) }} | |
baudrate: [115200, 230400] | |
include: ${{ fromJson(needs.build-matrix.outputs.ncp_matrix) }} | |
exclude: | |
- target: yellow | |
baudrate: 230400 | |
- target: skyconnect | |
baudrate: 230400 | |
uses: ./.github/workflows/silabs-firmware-build.yaml | |
with: | |
firmware_name: ncp-uart-hw-v${{ needs.build-container.outputs.ezsp_version}}-${{ matrix.target }}-${{ matrix.baudrate }} | |
project_file: "/gecko_sdk/protocol/zigbee/app/ncp/sample-app/ncp-uart-hw/ncp-uart-hw.slcp" | |
project_name: "ncp-uart-hw" | |
device: ${{ matrix.device }} | |
components: ${{ matrix.components }} | |
configuration: ${{ matrix.configuration }} | |
patchpath: "EmberZNet/${{ matrix.name }}" | |
slcp_yaml_changes: ${{ matrix.slcp_yaml_changes }} | |
extra_c_defs: ${{ matrix.extra_c_defs }} | |
sdk_version: ${{ needs.build-container.outputs.sdk_version}} | |
metadata_fw_type: "ncp-uart-hw" | |
baudrate: ${{ matrix.baudrate }} | |
metadata_extra: "{ \"ezsp_version\": \"${{ needs.build-container.outputs.ezsp_version}}\" }" | |
rcp-multi-pan-firmware-build: | |
name: RCP Multi-PAN | |
needs: [build-container, build-matrix] | |
strategy: | |
matrix: | |
target: ${{ fromJson(needs.build-matrix.outputs.targets) }} | |
baudrate: [230400, 460800] | |
include: ${{ fromJson(needs.build-matrix.outputs.rcp_matrix) }} | |
exclude: | |
- target: yellow | |
baudrate: 230400 | |
- target: skyconnect | |
baudrate: 230400 | |
- target: elelabs-elx0x3 | |
baudrate: 230400 | |
- target: zb-gw04-1v2 | |
baudrate: 460800 | |
uses: ./.github/workflows/silabs-firmware-build.yaml | |
with: | |
firmware_name: rcp-uart-802154-v${{ needs.build-container.outputs.sdk_version}}-${{ matrix.target }}-${{ matrix.baudrate }} | |
project_file: "/gecko_sdk/protocol/openthread/sample-apps/ot-ncp/rcp-uart-802154.slcp" | |
project_name: "rcp-uart-802154" | |
device: ${{ matrix.device }} | |
components: ${{ matrix.components }} | |
without_components: ${{ matrix.without_components }} | |
configuration: ${{ matrix.configuration }} | |
patchpath: "RCPMultiPAN/${{ matrix.name }}" | |
sdkpatchpath: "RCPMultiPAN/GeckoSDK" | |
slcp_yaml_changes: ${{ matrix.slcp_yaml_changes }} | |
extra_c_defs: ${{ matrix.extra_c_defs }} | |
sdk_version: ${{ needs.build-container.outputs.sdk_version}} | |
baudrate: ${{ matrix.baudrate }} | |
metadata_fw_type: "rcp-uart-802154" | |
ot-rcp-firmware-build: | |
name: OpenThread RCP | |
needs: [build-container, build-matrix] | |
strategy: | |
matrix: | |
target: ${{ fromJson(needs.build-matrix.outputs.targets) }} | |
baudrate: [230400, 460800] | |
include: ${{ fromJson(needs.build-matrix.outputs.ot_matrix) }} | |
exclude: | |
- target: yellow | |
baudrate: 230400 | |
- target: skyconnect | |
baudrate: 230400 | |
- target: elelabs-elx0x3 | |
baudrate: 230400 | |
- target: zb-gw04-1v2 | |
baudrate: 460800 | |
uses: ./.github/workflows/silabs-firmware-build.yaml | |
with: | |
firmware_name: ot-rcp-v${{ needs.build-container.outputs.ot_version}}-${{ matrix.target }}-${{ matrix.baudrate }} | |
project_file: "/gecko_sdk/protocol/openthread/sample-apps/ot-ncp/ot-rcp.slcp" | |
project_name: "ot-rcp" | |
device: ${{ matrix.device }} | |
components: ${{ matrix.components }} | |
configuration: ${{ matrix.configuration }} | |
patchpath: "OpenThreadRCP/${{ matrix.name }}" | |
sdkpatchpath: "OpenThreadRCP/GeckoSDK" | |
extra_c_defs: ${{ matrix.extra_c_defs }} | |
sdk_version: ${{ needs.build-container.outputs.sdk_version}} | |
metadata_fw_type: "ot-rcp" | |
baudrate: ${{ matrix.baudrate }} | |
metadata_extra: "{ \"ot_rcp_version\": \"SL-OPENTHREAD/2.4.1.0_GitHub-7074a43e4\" }" | |
collect_artifacts: | |
name: download and publish all artifacts | |
runs-on: ubuntu-latest | |
needs: [build-matrix, ezsp-firmware-build, rcp-multi-pan-firmware-build, ot-rcp-firmware-build] | |
steps: | |
- uses: actions/checkout@v3.3.0 | |
- uses: actions/download-artifact@v3 | |
with: | |
path: firmware_builds | |
- name: Reorganise artifact structure | |
run: | | |
set -e | |
targets='${{ needs.build-matrix.outputs.targets }}' | |
targets="$(echo "$targets" | jq -r '.[]')" | |
for t in $targets; do | |
mkdir -p $t | |
find *cp-uart-*/ ot-rcp*/ -maxdepth 1 -type f -name "*$t*.gbl" -exec sh -c 'cp "$0" "$1/$(basename "$0")"' {} "$t" \; | |
done | |
find *cp-uart-*/ ot-rcp*/ -maxdepth 1 -type f -name "*zbdongle*.gbl" ! -name "*460*" | while read f | |
do | |
mkdir -p zb-gw04-1v1 | |
new=$(basename $f | sed "s/zbdonglee/zb-gw04-1v1/") | |
cp $f zb-gw04-1v1/$new | |
done | |
rm -rf *cp-uart-*/ ot-rcp*/ | |
working-directory: firmware_builds | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update firmware builds | |
file_pattern: firmware_builds/**.gbl |