@@ -175,18 +175,79 @@ jobs:
175175 cd esp-matter/examples/light
176176 idf.py -B "../../../${BUILD_DIR}" build
177177
178+ - name : Prepare provisioning support bundle
179+ shell : bash
180+ run : |
181+ set -euo pipefail
182+ CHIP_ROOT="esp-matter/connectedhomeip/connectedhomeip"
183+ BUNDLE_ROOT="provisioning-support/connectedhomeip"
184+ mkdir -p "${BUNDLE_ROOT}/scripts/tools"
185+ mkdir -p "${BUNDLE_ROOT}/scripts/setup"
186+ mkdir -p "${BUNDLE_ROOT}/src/setup_payload"
187+ mkdir -p "${BUNDLE_ROOT}/credentials/test"
188+ cp "${CHIP_ROOT}/scripts/tools/generate_esp32_chip_factory_bin.py" "${BUNDLE_ROOT}/scripts/tools/"
189+ cp -R "${CHIP_ROOT}/scripts/tools/spake2p" "${BUNDLE_ROOT}/scripts/tools/"
190+ cp "${CHIP_ROOT}/scripts/setup/requirements.setuppayload.txt" "${BUNDLE_ROOT}/scripts/setup/"
191+ cp -R "${CHIP_ROOT}/src/setup_payload/python" "${BUNDLE_ROOT}/src/setup_payload/"
192+ cp -R "${CHIP_ROOT}/credentials/test/attestation" "${BUNDLE_ROOT}/credentials/test/"
193+ cp -R "${CHIP_ROOT}/credentials/test/certification-declaration" "${BUNDLE_ROOT}/credentials/test/"
194+ if [ -f "${CHIP_ROOT}/out/host/chip-cert" ]; then
195+ mkdir -p "${BUNDLE_ROOT}/out/host"
196+ cp "${CHIP_ROOT}/out/host/chip-cert" "${BUNDLE_ROOT}/out/host/"
197+ fi
198+
199+ - name : Prepare flashable firmware bundle
200+ shell : bash
201+ run : |
202+ set -euo pipefail
203+ python3 - <<'PY'
204+ import json
205+ import pathlib
206+ import shutil
207+
208+ build_dir = pathlib.Path("build/light-c6-thread")
209+ bundle_dir = pathlib.Path("release-bundle") / build_dir
210+ bundle_dir.mkdir(parents=True, exist_ok=True)
211+
212+ flasher_args_path = build_dir / "flasher_args.json"
213+ with flasher_args_path.open(encoding="utf-8") as flasher_args_file:
214+ flasher_args = json.load(flasher_args_file)
215+
216+ shutil.copy2(flasher_args_path, bundle_dir / "flasher_args.json")
217+ for relative_path in flasher_args["flash_files"].values():
218+ source = pathlib.PurePosixPath(relative_path)
219+ if source.is_absolute() or ".." in source.parts:
220+ raise SystemExit(f"Unsafe flash file path: {relative_path}")
221+ source_path = build_dir / pathlib.Path(*source.parts)
222+ target_path = bundle_dir / pathlib.Path(*source.parts)
223+ if not source_path.is_file():
224+ raise SystemExit(f"Missing flash file: {source_path}")
225+ target_path.parent.mkdir(parents=True, exist_ok=True)
226+ shutil.copy2(source_path, target_path)
227+ PY
228+ mkdir -p dist/light-core-input
229+ tar -C release-bundle -cf dist/light-core-input/light-c6-thread-firmware-bundle.tar build/light-c6-thread
230+
178231 - name : Save compiler cache
179232 if : always() && steps.restore-ccache.outputs.cache-hit != 'true'
180233 uses : actions/cache/save@v4
181234 with :
182235 path : .ccache
183236 key : ${{ steps.restore-ccache.outputs.cache-primary-key }}
184237
185- - name : Upload raw build tree
238+ - name : Upload flashable firmware bundle
239+ uses : actions/upload-artifact@v4
240+ with :
241+ name : light-c6-thread-firmware-bundle
242+ path : dist/light-core-input/light-c6-thread-firmware-bundle.tar
243+ if-no-files-found : error
244+ compression-level : 0
245+
246+ - name : Upload provisioning support bundle
186247 uses : actions/upload-artifact@v4
187248 with :
188- name : light-c6-thread-build-tree
189- path : build/light-c6-thread
249+ name : light-c6-thread-provisioning-support
250+ path : provisioning-support
190251 if-no-files-found : error
191252 compression-level : 0
192253
@@ -199,18 +260,25 @@ jobs:
199260 - name : Checkout repository
200261 uses : actions/checkout@v4
201262
202- - name : Download raw build tree
263+ - name : Download flashable firmware bundle
264+ uses : actions/download-artifact@v4
265+ with :
266+ name : light-c6-thread-firmware-bundle
267+ path : dist/light-core-input
268+
269+ - name : Download provisioning support bundle
203270 uses : actions/download-artifact@v4
204271 with :
205- name : light-c6-thread-build-tree
206- path : build/light-c6-thread
272+ name : light-c6-thread-provisioning-support
273+ path : .
207274
208275 - name : Package build artifacts
209276 shell : bash
210277 run : |
211278 set -euo pipefail
212279 mkdir -p dist/light-core
213- tar -C build -czf dist/light-core/light-c6-thread-build.tar.gz light-c6-thread
280+ tar -xf dist/light-core-input/light-c6-thread-firmware-bundle.tar
281+ tar -czf dist/light-core/light-c6-thread-build.tar.gz build/light-c6-thread provisioning-support
214282 cp docs/ci-and-releases.md dist/light-core/README-device-specific-build.md
215283
216284 - name : Upload packaged artifact
0 commit comments