Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
version: 2
updates:
# Stable 32-bit package.json
# Stable 32-bit package.json (Node.js ≤22 only)
- package-ecosystem: npm
directory: "/"
directory: "/stable/32bit"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
versioning-strategy: increase
ignore:
- dependency-name: "node"
versions: [">23.x"]
versions: [">22.x"]
labels:
- "Production"
- "32-bit"
commit-message:
prefix: "Production"
prefix: "Production(32-bit)"
include: "scope"

# Stable 64-bit package.json (Node.js ≤22 only)
- package-ecosystem: npm
directory: "/stable/64bit"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
versioning-strategy: increase
ignore:
- dependency-name: "node"
versions: [">22.x"]
labels:
- "Production"
- "64-bit"
commit-message:
prefix: "Production(64-bit)"
include: "scope"
3 changes: 2 additions & 1 deletion .github/workflows/stage-1_create_a_release_and_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ on:
branches:
- latest
paths:
- package.json
- stable/32bit/package.json
- stable/64bit/package.json

jobs:
merge_inputs:
Expand Down
23 changes: 21 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,26 @@

The package.json dependencies are used to manage the versions used within the release package. And Dependabot watches the versions, and creates a pull request if a version needs updating. Nothing else in package.json is used. If you manually update the dependencies, package-lock.json also needs updating.

Then once a change is made to package.json in the latest branch, originated by Depandabot, the stage 1 workflow will kick off.
## Package Configuration Structure

Starting with the Node.js 24 compatibility update, this repository uses architecture-specific package configurations:

### Stable Builds
- **`stable/64bit/package.json`**: Used for x86_64 and aarch64 (64-bit) architectures
- Can use any Node.js version (24+ supported)
- Monitored by Dependabot for automatic updates
- **`stable/32bit/package.json`**: Used for arm and i386 (32-bit) architectures
- Limited to Node.js ≤22 (due to Node.js dropping 32-bit support in v23)
- Monitored by Dependabot with Node.js version constraints
- **`package.json`** (root): Legacy configuration maintained for backwards compatibility

### Beta Builds
- **`beta/64bit/package.json`**: For 64-bit architectures with beta versions
- **`beta/32bit/package.json`**: For 32-bit architectures with beta versions (Node.js ≤22)

The build script automatically selects the appropriate configuration based on the target architecture (`QEMU_ARCH`) and release type (`PKG_RELEASE_TYPE`).

Then once a change is made to any package.json files in the latest branch (originated by Dependabot), the stage 1 workflow will kick off.

Release TAG is created by `reecetech/version-increment`, and is configured to increment the patch level every time, and not based on the package.json. To release a minor or major release, the manual workflow dispatch must be used, and package.json/package-lock.json manually updated.

Expand All @@ -17,7 +36,7 @@ Release TAG is created by `reecetech/version-increment`, and is configured to in
### Stage 1 - Create a pre-release and build APT package
>Average Execution time: Approx 40 minutes

This job is triggered when package.json is updated on the latest branch, and the author of the change is dependabot.
This job is triggered when any package.json file (stable/32bit, stable/64bit, or legacy root) is updated on the latest branch, and the author of the change is dependabot.

1. Determine release version based on either manual workflow input or the latest release.
2. Build apt packages for x86_64, Arm ( RPI 32 bit), and aarch64 ( RPI 64 bit ).
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ The project aims to deploy Homebridge and the Homebridge UI in a secure and stab

Supported architectures:

* x86_64
* armhf ( armv7) (Pls note that support for 32 Bit OS's will end in Spring of 2027)
* aarch64 (arm64)
* x86_64 (64-bit Intel/AMD)
* armhf (armv7) - 32-bit ARM (⚠️ **Node.js version limited to ≤22**)
* aarch64 (arm64) - 64-bit ARM

**Important:** Node.js dropped 32-bit support starting with version 23. The 32-bit ARM (armhf) packages are limited to Node.js 22.x and earlier. Support for 32-bit OS's will end in Spring of 2027.

## Using APT

Expand Down
2 changes: 1 addition & 1 deletion beta/64bit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"homebridge": "^2.0.0-beta.29",
"homebridge-config-ui-x": "^5.5.1-beta.4",
"homebridge-plugin-update-check": "^2.0.0-beta.2",
"node": "^24.7.0"
"node": "^24.12.0"
}
}
66 changes: 61 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
#!/bin/bash

# Homebridge APT Package Build Script
#
# This script builds Debian packages for Homebridge across multiple architectures.
#
# IMPORTANT: Node.js Version Constraints
# - Node.js 23+ dropped support for 32-bit architectures (ARM32, i386)
# - This script enforces Node.js ≤22 for 32-bit builds to prevent failures
# - 64-bit architectures (x86_64, aarch64) can use any Node.js version
#
# Package Configuration:
# - Alpha builds: Use alpha/64bit for x86_64/aarch64, alpha/32bit for arm/i386
# - Beta builds: Use beta/64bit for x86_64/aarch64, beta/32bit for arm/i386
# - Stable builds: Use stable/64bit for x86_64/aarch64, stable/32bit for arm/i386
#
# Run ./validate-config.sh to verify package configurations before building

set -e
set -x

#trap 'rm -rf staging *.tar.gz *.manifest /tmp/*' EXIT

# Determine if alpha, beta or stable config should be used
BUILD_ARCH=${QEMU_ARCH:-aarch64}
if [[ "$PKG_RELEASE_TYPE" == "beta" ]]; then
BUILD_ARCH=${QEMU_ARCH:-aarch64}
case "$BUILD_ARCH" in
x86_64|aarch64)
PACKAGE_JSON_PATH="beta/64bit/package.json"
Expand All @@ -18,7 +34,6 @@ if [[ "$PKG_RELEASE_TYPE" == "beta" ]]; then
*) echo "unsupported architecture"; exit 1 ;;
esac
elif [[ "$PKG_RELEASE_TYPE" == "alpha" ]]; then
BUILD_ARCH=${QEMU_ARCH:-aarch64}
case "$BUILD_ARCH" in
x86_64|aarch64)
PACKAGE_JSON_PATH="alpha/64bit/package.json"
Expand All @@ -29,11 +44,36 @@ elif [[ "$PKG_RELEASE_TYPE" == "alpha" ]]; then
*) echo "unsupported architecture"; exit 1 ;;
esac
else
PACKAGE_JSON_PATH="package.json"
# Stable builds also use architecture-specific configs
case "$BUILD_ARCH" in
x86_64|aarch64)
PACKAGE_JSON_PATH="stable/64bit/package.json"
;;
arm|i386)
PACKAGE_JSON_PATH="stable/32bit/package.json"
;;
*) echo "unsupported architecture"; exit 1 ;;
esac
fi

echo "🔧 Using $PACKAGE_JSON_PATH for version resolution"

# Validate package.json configuration
if [[ ! -f "$PACKAGE_JSON_PATH" ]]; then
echo "ERROR: Package configuration file not found: $PACKAGE_JSON_PATH"
exit 1
fi

NODE_VERSION_RAW=$(jq -r '.dependencies.node' "$PACKAGE_JSON_PATH")
if [[ "$NODE_VERSION_RAW" == "null" ]]; then
echo "ERROR: Node.js version not specified in $PACKAGE_JSON_PATH"
exit 1
fi

echo "📦 Package configuration: $PACKAGE_JSON_PATH"
echo "🟢 Node.js version: $NODE_VERSION_RAW"
echo "🏗️ Target architecture: $BUILD_ARCH"

# Update changelog if version info is present
if [[ -n "${PKG_RELEASE_TYPE}" && -n "${PKG_RELEASE_VERSION}" ]]; then
cd deb
Expand Down Expand Up @@ -62,14 +102,20 @@ case "$BUILD_ARCH" in
x86_64) NODE_ARCH='x64' ;;
arm)
if [ "$MAJOR_NODE" -gt 22 ]; then
echo "Skipping arm build as NodeJS > 22 on 32 Bit OS's is no longer supported"
echo "ERROR: Node.js $MAJOR_NODE is not supported on 32-bit ARM (armv7l) architecture"
echo "Node.js dropped 32-bit support starting with version 23"
echo "Please use Node.js 22.x or earlier for ARM32 builds"
echo "Current configuration uses Node.js $NODE_VERSION from $PACKAGE_JSON_PATH"
exit 1
fi
NODE_ARCH='armv7l' ;;
aarch64) NODE_ARCH='arm64' ;;
i386)
if [ "$MAJOR_NODE" -gt 22 ]; then
echo "Skipping i386 build as NodeJS > 22 on 32 Bit OS's is no longer supported"
echo "ERROR: Node.js $MAJOR_NODE is not supported on 32-bit x86 (i386) architecture"
echo "Node.js dropped 32-bit support starting with version 23"
echo "Please use Node.js 22.x or earlier for i386 builds"
echo "Current configuration uses Node.js $NODE_VERSION from $PACKAGE_JSON_PATH"
exit 1
fi
NODE_ARCH='x86' ;;
Expand All @@ -88,9 +134,19 @@ echo "|NodeJS| $NODE_VERSION |" >> "$MANIFEST"

# Download and unpack NodeJS binary
if [ ! -f "node-$NODE_VERSION-linux-$NODE_ARCH.tar.gz" ]; then
# Additional safety check: Ensure we're not trying to download Node.js >22 for 32-bit architectures
if [[ ("$NODE_ARCH" == "armv7l" || "$NODE_ARCH" == "x86") && "$MAJOR_NODE" -gt 22 ]]; then
echo "ERROR: Cannot download Node.js $NODE_VERSION for 32-bit architecture $NODE_ARCH"
echo "Node.js versions greater than 22 do not support 32-bit architectures"
echo "Please use Node.js 22.x or earlier for ARM32/i386 builds"
exit 1
fi

if [[ "$NODE_ARCH" == "armv6l" || "$NODE_ARCH" == "x86" ]]; then
echo "Downloading Node.js $NODE_VERSION for 32-bit architecture $NODE_ARCH from unofficial builds..."
curl -fSLO "https://unofficial-builds.nodejs.org/download/release/$NODE_VERSION/node-$NODE_VERSION-linux-$NODE_ARCH.tar.gz"
else
echo "Downloading Node.js $NODE_VERSION for architecture $NODE_ARCH from official builds..."
curl -fSLO "https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-linux-$NODE_ARCH.tar.gz"
fi
fi
Expand Down
Loading
Loading