1
1
# Copilot Instructions for homebridge-apt-pkg
2
2
3
+ Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
4
+
3
5
## Repository Summary
4
6
5
7
This repository builds and publishes Debian/Ubuntu APT packages for Homebridge, a HomeKit bridge server. It's primarily a ** packaging repository** , not a source code repository. The main purpose is to create self-contained APT packages that bundle Node.js, Homebridge, and Homebridge UI together for easy installation on Debian-based systems.
@@ -29,22 +31,26 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset
29
31
30
32
#### Build for x86_64 (AMD64)
31
33
``` bash
32
- # Build Docker image
34
+ # Build Docker image - NEVER CANCEL: Takes 5-10 minutes. Set timeout to 15+ minutes.
33
35
docker build -f build/Dockerfile --build-arg BASE_IMAGE=library/debian:bullseye --build-arg QEMU_ARCH=x86_64 -t package-build .
34
36
35
- # Build package (takes ~ 10-15 minutes)
37
+ # Build package - NEVER CANCEL: Takes 10-15 minutes. Set timeout to 30+ minutes.
36
38
docker run --rm -v $( pwd) :/repo -e PKG_RELEASE_TYPE=" stable" -e PKG_RELEASE_VERSION=" 1.0.0" package-build
37
39
```
38
40
39
41
#### Build for ARM64
40
42
``` bash
43
+ # NEVER CANCEL: Takes 5-10 minutes. Set timeout to 15+ minutes.
41
44
docker build -f build/Dockerfile --build-arg BASE_IMAGE=arm64v8/debian:bullseye --build-arg QEMU_ARCH=aarch64 -t package-build .
45
+ # NEVER CANCEL: Takes 10-15 minutes. Set timeout to 30+ minutes.
42
46
docker run --rm -v $( pwd) :/repo -e PKG_RELEASE_TYPE=" stable" -e PKG_RELEASE_VERSION=" 1.0.0" package-build
43
47
```
44
48
45
49
#### Build for ARM32 (Raspberry Pi)
46
50
``` bash
51
+ # NEVER CANCEL: Takes 5-10 minutes. Set timeout to 15+ minutes.
47
52
docker build -f build/Dockerfile --build-arg BASE_IMAGE=balenalib/raspberrypi3-debian:bullseye --build-arg QEMU_ARCH=arm -t package-build .
53
+ # NEVER CANCEL: Takes 10-15 minutes. Set timeout to 30+ minutes.
48
54
docker run --rm -v $( pwd) :/repo -e PKG_RELEASE_TYPE=" stable" -e PKG_RELEASE_VERSION=" 1.0.0" package-build
49
55
```
50
56
@@ -234,6 +240,7 @@ The `homebridge-beta-bot` automatically manages beta dependency updates via `.gi
234
240
- ** Long build times:** Package builds download Node.js and compile native modules (~ 10-15 min per arch)
235
241
- ** Network connectivity:** Docker builds require internet access to download dependencies
236
242
- ** No rollback:** Force push not available, use new commits for fixes
243
+ - ** No linting:** This repository has no linting tools or scripts configured
237
244
238
245
## Validation Steps
239
246
@@ -254,9 +261,77 @@ The `homebridge-beta-bot` automatically manages beta dependency updates via `.gi
254
261
4 . ** UI Test:** Web interface accessible on port 8581 (default)
255
262
5 . ** Plugin Test:** Basic plugin installation works via UI
256
263
264
+ ## Testing Changelog Generation
265
+
266
+ You can test the changelog generation feature outside of the full release process:
267
+
268
+ ``` bash
269
+ # Test stable changelog generation
270
+ ./test/test-changelog.sh
271
+
272
+ # Test beta changelog generation
273
+ PKG_RELEASE_TYPE=beta ./test/test-changelog.sh
274
+
275
+ # Test with custom parameters
276
+ PKG_RELEASE_TYPE=beta PKG_RELEASE_VERSION=1.2.3-beta.1 OUTPUT_FILE=my-test.md ./test/test-changelog.sh
277
+ ```
278
+
279
+ The test script:
280
+ - Replicates the exact changelog logic from ` build.sh `
281
+ - Allows testing different release types (stable/beta)
282
+ - Shows which tags and commits would be included
283
+ - Generates a sample manifest file for review
284
+ - Provides helpful output about available tags and commit counts
285
+
286
+ This is useful for:
287
+ - Validating changelog logic changes before releases
288
+ - Understanding what commits will be included in upcoming releases
289
+ - Testing edge cases (no tags, no commits, etc.)
290
+
291
+ ## Manual Validation Scenarios
292
+
293
+ After making any changes to package scripts or configuration, always run through these validation scenarios:
294
+
295
+ 1 . ** Changelog Generation Test** (< 10 seconds):
296
+ ``` bash
297
+ ./test/test-changelog.sh
298
+ PKG_RELEASE_TYPE=beta ./test/test-changelog.sh
299
+ ```
300
+
301
+ 2 . ** Build Script Analysis** (< 30 seconds):
302
+ ``` bash
303
+ # Verify build script syntax
304
+ bash -n build.sh
305
+
306
+ # Check that build.sh downloads correct Node.js version
307
+ cat package.json | jq -r ' .dependencies.node'
308
+ ```
309
+
310
+ 3 . ** Package Structure Validation** (< 30 seconds):
311
+ ``` bash
312
+ # Verify Debian package files exist and are valid
313
+ find deb/ -name " *.install" -o -name " control" -o -name " preinst" -o -name " postinst" -o -name " postrm"
314
+
315
+ # Check systemd service file syntax
316
+ systemd-analyze verify deb/etc/systemd/system/homebridge.service || echo " systemd-analyze not available - validation skipped"
317
+ ```
318
+
319
+ 4 . ** Dependencies Validation** (< 30 seconds):
320
+ ``` bash
321
+ # Verify all package.json files are valid JSON
322
+ jq empty package.json beta/32bit/package.json beta/64bit/package.json
323
+
324
+ # Check version consistency
325
+ echo " Stable deps:" && jq -r ' .dependencies | keys[]' package.json
326
+ echo " Beta 64-bit deps:" && jq -r ' .dependencies | keys[]' beta/64bit/package.json
327
+ ```
328
+
329
+ ** NOTE:** Full Docker builds take 10-40 minutes and require network access. Use these quick validation steps for iterative development.
330
+
257
331
## Additional Notes
258
332
259
333
- This repository uses ** functional testing only** - no unit tests
334
+ - ** No linting tools** - no eslint, shellcheck, or similar tools configured
260
335
- Changes trigger expensive build processes (~ 40+ minutes)
261
336
- Most validation happens in CI/CD pipelines, not locally
262
337
- The package creates an isolated Node.js environment at ` /opt/homebridge/ `
0 commit comments