Skip to content

Commit a70d65e

Browse files
authored
Merge pull request #34 from agners/use-git-submodule
Use git submodule to reference Matter SDK
2 parents e961bd3 + 230651b commit a70d65e

File tree

5 files changed

+51
-38
lines changed

5 files changed

+51
-38
lines changed

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gitsubmodule"
4+
directory: "/"
5+
allow:
6+
- dependency-name: "connectedhomeip"
7+
schedule:
8+
interval: "daily"
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/build.yaml

+19-34
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: CHIP wheels build
22

33
on: push
44

5-
env:
6-
matter_sdk_ref: v1.2.0.1
7-
85
jobs:
96
build_prepare:
107
name: Prepare build
@@ -16,6 +13,7 @@ jobs:
1613
- name: Checkout build repository
1714
uses: actions/checkout@v4
1815
with:
16+
submodules: true
1917
fetch-depth: 0
2018
- name: Get version
2119
id: version
@@ -43,37 +41,32 @@ jobs:
4341
fi
4442
echo "Building version $version"
4543
echo "version=$version" >> "$GITHUB_OUTPUT"
46-
- name: Checkout CHIP SDK repository
47-
uses: actions/checkout@v4
48-
with:
49-
repository: project-chip/connectedhomeip
50-
ref: ${{ env.matter_sdk_ref }}
51-
path: ./project-chip
5244
- name: Checkout submodules
53-
working-directory: ./project-chip
45+
working-directory: ./connectedhomeip/
5446
run: scripts/checkout_submodules.py --shallow --platform linux
5547
- name: Apply patches
56-
working-directory: ./project-chip
48+
working-directory: ./connectedhomeip/
5749
run: |
5850
for patch in ../*.patch
5951
do
6052
echo "Applying ${patch}"
6153
patch -p1 < $patch
6254
done
6355
- name: Bootstrap
64-
working-directory: ./project-chip
56+
working-directory: ./connectedhomeip/
6557
run: bash scripts/bootstrap.sh -p all,linux
6658
- name: ZAP Code pre-generation
67-
working-directory: ./project-chip
59+
working-directory: ./connectedhomeip/
6860
run: scripts/run_in_build_env.sh "scripts/codepregen.py ./zzz_pregenerated/"
6961
- name: Create Matter SDK tar
70-
working-directory: ./project-chip
71-
run: tar -caf ../project-chip.tar.zst --exclude .environment --use-compress-program=zstdmt .
62+
run: |
63+
tar -caf ../connectedhomeip.tar.zst --exclude ./connectedhomeip/.environment --use-compress-program=zstdmt .
64+
mv ../connectedhomeip.tar.zst ./connectedhomeip.tar.zst
7265
- name: Store Matter SDK as artifact
7366
uses: actions/upload-artifact@v4
7467
with:
7568
name: matter-sdk-${{ github.run_id }}
76-
path: ./project-chip.tar.zst
69+
path: ./connectedhomeip.tar.zst
7770

7871
build_linux_python_lib:
7972
name: Build Python wheels for Linux (${{ matrix.arch.name }})
@@ -95,7 +88,7 @@ jobs:
9588

9689
defaults:
9790
run:
98-
working-directory: ./project-chip
91+
working-directory: ./connectedhomeip/
9992

10093
container:
10194
image: ${{ matrix.arch.container }}
@@ -112,13 +105,10 @@ jobs:
112105
- name: Extract Matter SDK from tar
113106
working-directory: ./
114107
run: |
115-
rm -rf project-chip
116-
mkdir -p project-chip
117-
cd project-chip
118108
apt update && apt install zstd
119-
tar -xaf ../project-chip.tar.zst --use-compress-program=zstdmt .
109+
rm -rf connectedhomeip/
110+
tar -xaf ./connectedhomeip.tar.zst --use-compress-program=zstdmt .
120111
git config --global --add safe.directory "*"
121-
rm -rf out/
122112
- name: Bootstrap
123113
run: bash scripts/bootstrap.sh -p all,linux
124114
- name: Setup Build, Run Build and Run Tests
@@ -147,7 +137,7 @@ jobs:
147137
uses: actions/upload-artifact@v4
148138
with:
149139
name: chip-wheels-linux-${{ matrix.arch.name }}
150-
path: project-chip/out/controller/python/*.whl
140+
path: ./connectedhomeip/out/controller/python/*.whl
151141
- name: Upload wheels as release assets
152142
uses: softprops/action-gh-release@v1
153143
if: startsWith(github.ref, 'refs/tags/')
@@ -192,32 +182,27 @@ jobs:
192182

193183
defaults:
194184
run:
195-
working-directory: ./project-chip
185+
working-directory: ./connectedhomeip/
196186

197187
steps:
198188
- name: Checkout build repository
199189
uses: actions/checkout@v4
200190
with:
191+
submodules: true
201192
fetch-depth: 0
202-
- name: Checkout CHIP SDK repository
203-
uses: actions/checkout@v4
204-
with:
205-
repository: project-chip/connectedhomeip
206-
ref: ${{ env.matter_sdk_ref }}
207-
path: ./project-chip
208193
- name: Checkout submodules
209-
working-directory: ./project-chip
194+
working-directory: ./connectedhomeip/
210195
run: scripts/checkout_submodules.py --shallow --platform darwin
211196
- name: Apply patches
212-
working-directory: ./project-chip
197+
working-directory: ./connectedhomeip/
213198
run: |
214199
for patch in ../*.patch
215200
do
216201
echo "Applying ${patch}"
217202
patch -p1 < $patch
218203
done
219204
- name: Bootstrap
220-
working-directory: ./project-chip
205+
working-directory: ./connectedhomeip/
221206
run: bash scripts/bootstrap.sh -p all,darwin
222207
- name: Setup Build, Run Build and Run Tests
223208
run: |
@@ -249,7 +234,7 @@ jobs:
249234
uses: softprops/action-gh-release@v1
250235
if: startsWith(github.ref, 'refs/tags/')
251236
with:
252-
files: project-chip/out/controller/python/*.whl
237+
files: connectedhomeip/out/controller/python/*.whl
253238
- name: Upload wheels to PyPI
254239
if: startsWith(github.ref, 'refs/tags/')
255240
env:

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "connectedhomeip"]
2+
path = connectedhomeip
3+
url = https://github.com/project-chip/connectedhomeip.git

README.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
## Project Matter Python Device Controller Wheels
1+
## Matter Python Device Controller Wheels
2+
3+
This repository provides the building infrastructure to build Python wheels of
4+
the Matter device controller. It uses the [official project Matter SDK](https://github.com/project-chip/connectedhomeip/)
5+
and builds the Python bindings available at `src/controller/python/`. The
6+
bindings use the official Matter implementation wriitten in C++ as a native
7+
library using ctypes bindings. The `chip-core` wheel contains this native
8+
library. Hence the `chip-core` wheel is a platform specific wheel.
9+
10+
Binary wheels of (tagged) releases and pre-releases for Linux x86-64 and
11+
aarch64/arm64 as well as macOS aarch64/arm64 are available from our Home
12+
Assistant CHIP repositories at:
13+
14+
- [home-assistant-chip-repl](https://pypi.org/project/home-assistant-chip-repl/)
15+
- [home-assistant-chip-core](https://pypi.org/project/home-assistant-chip-core/) (contains the native dependency)
16+
- [home-assistant-chip-clusters](https://pypi.org/project/home-assistant-chip-clusters/)
217

3-
This repository provides the building infrastructure to build Python wheels for
4-
the Linux platform. It uses the [official project Matter SDK](https://github.com/project-chip/connectedhomeip/)
5-
to build the wheels.

connectedhomeip

Submodule connectedhomeip added at 181b0cb

0 commit comments

Comments
 (0)