Release CHIP Tools #56
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
# Copyright (c) 2021 Project CHIP Authors | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: Release CHIP Tools | |
on: | |
workflow_dispatch: | |
inputs: | |
commit: | |
description: "Release tag name or commit SHA:" | |
required: true | |
publishRelease: | |
description: "Publish release packages (if true, 'commit' must contain a release tag name):" | |
required: true | |
default: "false" | |
jobs: | |
tools: | |
name: Build CHIP Tools | |
timeout-minutes: 60 | |
runs-on: ubuntu-20.04 | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
container: | |
image: ubuntu:20.04 | |
volumes: | |
- "/tmp/log_output:/tmp/test_logs" | |
- "/tmp/output_binaries:/tmp/output_binaries" | |
steps: | |
- name: Install dependencies | |
timeout-minutes: 10 | |
run: | | |
export CODENAME=$(cat /etc/os-release | grep UBUNTU_CODENAME | cut -d= -f2) | |
apt update | |
apt install -y --no-install-recommends gnupg ca-certificates | |
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${CODENAME} main" > /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-${CODENAME}.list | |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA6932366A755776 | |
apt update | |
apt install -y --no-install-recommends python3.11 python3.11-dev python3.11-venv g++ git libffi-dev libglib2.0-dev-bin libghc-gio-dev zlib1g-dev libavahi-client-dev libavahi-common-dev libgirepository-1.0-1 libssl-dev binutils-aarch64-linux-gnu | |
ln -snf /usr/bin/python3.11 /usr/bin/python | |
ln -snf /usr/bin/python3.11 /usr/bin/python3 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: "${{ github.event.inputs.commit }}" | |
- name: Bootstrap | |
timeout-minutes: 10 | |
uses: ./.github/actions/checkout-submodules-and-bootstrap | |
with: | |
platform: linux | |
- name: Install CHIP Tool dependencies | |
timeout-minutes: 10 | |
run: | | |
export CODENAME=$(cat /etc/os-release | grep UBUNTU_CODENAME | cut -d= -f2) | |
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${CODENAME} main restricted" > /etc/apt/sources.list.d/arm64.list | |
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${CODENAME}-updates main restricted" >> /etc/apt/sources.list.d/arm64.list | |
apt update | |
apt install -y --no-install-recommends -o APT::Immediate-Configure=false g++-aarch64-linux-gnu libgirepository1.0-dev | |
dpkg --add-architecture arm64 | |
apt install -y --no-install-recommends -o APT::Immediate-Configure=false libavahi-client-dev:arm64 libglib2.0-dev:arm64 libssl-dev:arm64 libreadline-dev:arm64 | |
- name: Build x64 CHIP Tool with debug logs enabled | |
timeout-minutes: 10 | |
run: | | |
scripts/run_in_build_env.sh "gn gen out/chiptool_x64_debug --args='chip_mdns=\"platform\" chip_crypto=\"mbedtls\" symbol_level=0 is_debug=false'" | |
scripts/run_in_build_env.sh "ninja -C out/chiptool_x64_debug chip-tool" | |
strip out/chiptool_x64_debug/chip-tool -o /tmp/output_binaries/chip-tool_x64 | |
- name: Build x64 OTA Provider | |
timeout-minutes: 10 | |
run: | | |
scripts/run_in_build_env.sh "gn gen out/chipotaprovider_x64 --args='symbol_level=0 is_debug=false chip_crypto=\"mbedtls\"' --root=examples/ota-provider-app/linux" | |
scripts/run_in_build_env.sh "ninja -C out/chipotaprovider_x64 chip-ota-provider-app" | |
strip out/chipotaprovider_x64/chip-ota-provider-app -o /tmp/output_binaries/chip-ota-provider-app_x64 | |
- name: Build x64 Chip Cert | |
timeout-minutes: 10 | |
run: | | |
scripts/run_in_build_env.sh "gn gen out/chipcert_x64 --args='symbol_level=0 is_debug=false chip_crypto=\"boringssl\"'" | |
scripts/run_in_build_env.sh "ninja -C out/chipcert_x64 chip-cert" | |
strip out/chipcert_x64/chip-cert -o /tmp/output_binaries/chip-cert_x64 | |
- name: Build x64 Python Wheels | |
timeout-minutes: 10 | |
run: | | |
scripts/build_python.sh --enable_ble true --chip_detail_logging true --chip_mdns platform | |
python3 -m zipfile -c /tmp/output_binaries/python_matter_controller.zip \ | |
out/python_lib/controller/python/chip_clusters-0.0-py3-none-any.whl \ | |
out/python_lib/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl \ | |
out/python_lib/obj/scripts/matter_yamltests_distribution._build_wheel/*.whl | |
- name: Build arm64 CHIP Tool with debug logs enabled | |
timeout-minutes: 10 | |
run: | | |
scripts/run_in_build_env.sh "gn gen out/chiptool_arm64_debug --args='chip_mdns=\"platform\" | |
custom_toolchain=\"//build/toolchain/custom\" | |
target_cc=\"aarch64-linux-gnu-gcc\" | |
target_cxx=\"aarch64-linux-gnu-g++\" | |
target_ar=\"aarch64-linux-gnu-ar\" | |
target_cpu=\"arm64\" | |
symbol_level=0 | |
is_debug=false | |
chip_crypto=\"mbedtls\"'" | |
scripts/run_in_build_env.sh "ninja -C out/chiptool_arm64_debug chip-tool" | |
aarch64-linux-gnu-strip out/chiptool_arm64_debug/chip-tool -o /tmp/output_binaries/chip-tool_arm64 | |
- name: Upload release packages | |
uses: softprops/action-gh-release@v1 | |
if: github.event.inputs.publishRelease == 'true' | |
with: | |
files: /tmp/output_binaries/* | |
fail_on_unmatched_files: true | |
tag_name: "${{ github.event.inputs.commit }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload packages | |
uses: actions/upload-artifact@v4 | |
if: github.event.inputs.publishRelease == 'false' | |
with: | |
path: /tmp/output_binaries | |
name: "test-${{ github.event.inputs.commit }}" | |
if-no-files-found: error | |
overwrite: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |