Update Matter SDK to d7abcbfc3a
#481
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: CHIP wheels build | |
on: push | |
jobs: | |
build_prepare: | |
name: Prepare build | |
runs-on: ubuntu-22.04 | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
channel: ${{ steps.version.outputs.channel }} | |
steps: | |
- name: Checkout build repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Get version | |
id: version | |
shell: bash | |
run: | | |
version=$(echo "${{ github.ref }}" | awk -F"/" '{print $NF}') | |
if [[ ! -z "${{ github.event.inputs.version }}" ]]; then | |
version="${{ github.event.inputs.version }}" | |
elif [[ "${version}" =~ (main|dev) ]]; then | |
today="$(date --utc '+%Y-%m-%d')" | |
midnight_timestamp="$(date --utc +%s --date=$today)" | |
calver_date="$(date --utc --date=$today '+%Y.%-m.dev%-d')" | |
commit_count="$(git rev-list --count --since=$midnight_timestamp HEAD)" | |
commit_count="$(printf "%02d" ${commit_count})" | |
version="${calver_date}${commit_count}" | |
elif [[ "${{ github.ref }}" =~ ^refs/heads/ ]]; then | |
today="$(date --utc '+%Y-%m-%d')" | |
midnight_timestamp="$(date --utc +%s --date=$today)" | |
calver_date="$(date --utc --date=$today '+%Y.%-m.dev%-d')" | |
# Remove invalid chars | |
localversion="${version}" | |
localversion="${localversion//-/}" | |
localversion="${localversion//_/}" | |
version="${calver_date}+${localversion}" | |
fi | |
echo "Building version $version" | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
- name: Checkout submodules | |
working-directory: ./connectedhomeip/ | |
run: scripts/checkout_submodules.py --shallow --platform linux | |
- name: Apply patches | |
working-directory: ./connectedhomeip/ | |
run: | | |
for patch in ../*.patch | |
do | |
echo "Applying ${patch}" | |
patch -p1 < $patch | |
done | |
- name: Bootstrap | |
working-directory: ./connectedhomeip/ | |
run: bash scripts/bootstrap.sh -p all,linux | |
- name: ZAP Code pre-generation | |
working-directory: ./connectedhomeip/ | |
run: scripts/run_in_build_env.sh "scripts/codepregen.py ./zzz_pregenerated/" | |
- name: Create Matter SDK tar | |
run: | | |
tar -caf ../connectedhomeip.tar.zst --exclude ./connectedhomeip/.environment --use-compress-program=zstdmt . | |
mv ../connectedhomeip.tar.zst ./connectedhomeip.tar.zst | |
- name: Store Matter SDK as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: matter-sdk-${{ github.run_id }} | |
path: ./connectedhomeip.tar.zst | |
build_linux_python_lib: | |
name: Build Python wheels for Linux (${{ matrix.arch.name }}) | |
needs: build_prepare | |
strategy: | |
matrix: | |
arch: | |
- name: x86_64 | |
container: ghcr.io/project-chip/chip-build:1 | |
runner: ubuntu-22.04 | |
- name: aarch64 | |
container: docker.io/agners/aarch64-chip-build:1 | |
runner: ARM64 | |
runs-on: ${{ matrix.arch.runner }} | |
permissions: | |
contents: write # for actions/upload-release-asset to upload release asset | |
defaults: | |
run: | |
working-directory: ./connectedhomeip/ | |
container: | |
image: ${{ matrix.arch.container }} | |
volumes: | |
- "/tmp/log_output:/tmp/test_logs" | |
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 | |
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" | |
steps: | |
- name: Restore Matter SDK from artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: matter-sdk-${{ github.run_id }} | |
- name: Extract Matter SDK from tar | |
working-directory: ./ | |
run: | | |
apt update && apt install zstd | |
rm -rf connectedhomeip/ | |
tar -xaf ./connectedhomeip.tar.zst --use-compress-program=zstdmt . | |
git config --global --add safe.directory "*" | |
- name: Bootstrap | |
run: bash scripts/bootstrap.sh -p all,linux | |
- name: Setup Build, Run Build and Run Tests | |
run: | | |
scripts/build/gn_gen.sh --args=" \ | |
chip_project_config_include_dirs=[\"//..\"] \ | |
chip_crypto=\"boringssl\" | |
enable_rtti=true \ | |
chip_config_memory_debug_checks=false \ | |
chip_config_memory_debug_dmalloc=false \ | |
chip_exchange_node_id_logging=true \ | |
chip_mdns=\"minimal\" \ | |
chip_minmdns_default_policy=\"libnl\" \ | |
chip_python_version=\"${{ needs.build_prepare.outputs.version }}\" \ | |
chip_python_package_prefix=\"home-assistant-chip\" \ | |
chip_python_platform_tag=\"manylinux_2_31\" \ | |
chip_code_pre_generated_directory=\"$(pwd)/zzz_pregenerated\" \ | |
" | |
scripts/run_in_build_env.sh "ninja -C ./out chip-repl" | |
- name: Run Python library specific unit tests | |
run: | | |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/home_assistant_chip_core-${{ needs.build_prepare.outputs.version }}-cp37-abi3-manylinux_2_31_${{ matrix.arch.name }}.whl' | |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/home_assistant_chip_clusters-${{ needs.build_prepare.outputs.version }}-py3-none-any.whl' | |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/home_assistant_chip_repl-${{ needs.build_prepare.outputs.version }}-py3-none-any.whl' | |
scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)' | |
- name: Upload wheels as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chip-wheels-linux-${{ matrix.arch.name }} | |
path: ./connectedhomeip/out/controller/python/*.whl | |
- name: Upload wheels as release assets | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./connectedhomeip/out/controller/python/*.whl | |
- name: Upload wheels to PyPI | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN_PYPI }} | |
TWINE_REPOSITORY: "pypi" | |
run: | | |
python3 -m pip install twine build | |
python3 -m twine upload out/controller/python/home_assistant_chip_clusters-${{ needs.build_prepare.outputs.version }}-py3-none-any.whl --skip-existing | |
python3 -m twine upload out/controller/python/home_assistant_chip_core-${{ needs.build_prepare.outputs.version }}-cp37-abi3-manylinux_2_31_${{ matrix.arch.name }}.whl --skip-existing | |
python3 -m twine upload out/controller/python/home_assistant_chip_repl-${{ needs.build_prepare.outputs.version }}-py3-none-any.whl --skip-existing | |
- name: Upload wheels to Test PyPI | |
if: ${{ github.ref == 'refs/heads/main' }} | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN_TESTPYPI }} | |
TWINE_REPOSITORY: "testpypi" | |
run: | | |
python3 -m pip install twine build | |
python3 -m twine upload out/controller/python/home_assistant_chip_clusters-${{ needs.build_prepare.outputs.version }}-py3-none-any.whl --skip-existing | |
python3 -m twine upload out/controller/python/home_assistant_chip_core-${{ needs.build_prepare.outputs.version }}-cp37-abi3-manylinux_2_31_${{ matrix.arch.name }}.whl --skip-existing | |
python3 -m twine upload out/controller/python/home_assistant_chip_repl-${{ needs.build_prepare.outputs.version }}-py3-none-any.whl --skip-existing | |
build_macos_python_lib: | |
name: Build Python wheels for macOS (${{ matrix.arch.name }}) | |
needs: build_prepare | |
strategy: | |
matrix: | |
arch: | |
- name: arm64 | |
runner: macos-14 | |
runs-on: ${{ matrix.arch.runner }} | |
permissions: | |
contents: write # for actions/upload-release-asset to upload release asset | |
defaults: | |
run: | |
working-directory: ./connectedhomeip/ | |
steps: | |
- name: Checkout build repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Checkout submodules | |
working-directory: ./connectedhomeip/ | |
run: scripts/checkout_submodules.py --shallow --platform darwin | |
- name: Apply patches | |
working-directory: ./connectedhomeip/ | |
run: | | |
for patch in ../*.patch | |
do | |
echo "Applying ${patch}" | |
patch -p1 < $patch | |
done | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Bootstrap | |
working-directory: ./connectedhomeip/ | |
run: bash scripts/bootstrap.sh -p all,darwin | |
- name: Setup Build, Run Build and Run Tests | |
run: | | |
scripts/build/gn_gen.sh --args=" \ | |
chip_crypto=\"boringssl\" | |
enable_rtti=true \ | |
chip_config_memory_debug_checks=false \ | |
chip_config_memory_debug_dmalloc=false \ | |
chip_mdns=\"minimal\" \ | |
chip_minmdns_default_policy=\"default\" \ | |
chip_python_version=\"${{ needs.build_prepare.outputs.version }}\" \ | |
chip_python_package_prefix=\"home-assistant-chip\" \ | |
chip_python_platform_tag=\"macosx_14_0\" \ | |
" | |
scripts/run_in_build_env.sh "ninja -C ./out chip-repl" | |
- name: Run Python library specific unit tests | |
run: | | |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/home_assistant_chip_core-${{ needs.build_prepare.outputs.version }}-cp37-abi3-macosx_14_0_${{ matrix.arch.name }}.whl' | |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/home_assistant_chip_clusters-${{ needs.build_prepare.outputs.version }}-py3-none-any.whl' | |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/home_assistant_chip_repl-${{ needs.build_prepare.outputs.version }}-py3-none-any.whl' | |
scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)' | |
- name: Upload wheels as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chip-wheels-macosx-${{ matrix.arch.name }} | |
path: ./connectedhomeip/out/controller/python/*.whl | |
- name: Upload wheels as release assets | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: connectedhomeip/out/controller/python/*.whl | |
- name: Upload wheels to PyPI | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN_PYPI }} | |
TWINE_REPOSITORY: "pypi" | |
run: | | |
python3 -m pip install twine build | |
python3 -m twine upload out/controller/python/home_assistant_chip_core-${{ needs.build_prepare.outputs.version }}-cp37-abi3-macosx_14_0_${{ matrix.arch.name }}.whl --skip-existing | |
- name: Upload wheels to Test PyPI | |
if: ${{ github.ref == 'refs/heads/main' }} | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN_TESTPYPI }} | |
TWINE_REPOSITORY: "testpypi" | |
run: | | |
python3 -m pip install twine build | |
python3 -m twine upload out/controller/python/home_assistant_chip_core-${{ needs.build_prepare.outputs.version }}-cp37-abi3-macosx_14_0_${{ matrix.arch.name }}.whl --skip-existing |