forked from NabuCasa/silabs-firmware-builder
-
-
Notifications
You must be signed in to change notification settings - Fork 41
194 lines (183 loc) · 6.98 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
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.2
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.2.0
ezsp_version: 7.4.2.0
steps:
- uses: actions/[email protected]
- name: Log in to the GitHub container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Build and Push
uses: docker/[email protected]
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.2.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/[email protected]
- 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