From 5c0a3686048e5b202160754174f4404792a1d7e0 Mon Sep 17 00:00:00 2001 From: mm644706215 Date: Wed, 25 Mar 2026 22:19:24 +0800 Subject: [PATCH] feat: upgrade arm64 musl node runtime to 24.14.1 --- .github/workflows/build-node-musl.yml | 21 ++++++++++++--------- root/usr/bin/openclaw-env | 4 ++-- tests/test_node_packaging_contract.sh | 9 ++++++++- tests/test_openclaw_node.sh | 26 +++++++++++++------------- 4 files changed, 35 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-node-musl.yml b/.github/workflows/build-node-musl.yml index 0ed92d7..cdac4ca 100644 --- a/.github/workflows/build-node-musl.yml +++ b/.github/workflows/build-node-musl.yml @@ -9,7 +9,7 @@ on: default: true type: boolean build_v2: - description: 'Build V2 (23.2.0) - Current version' + description: 'Build V2 (24.14.1) - Current LTS version' required: false default: true type: boolean @@ -89,7 +89,7 @@ jobs: name: node-arm64-musl-v1 path: dist/*.tar.xz - # ── V2 构建: 使用交叉编译模式 (23.2.0) ── + # ── V2 构建: 使用 Alpine edge apk 模式 (24.14.1 LTS) ── build-v2: name: Build Node.js V2 (Current) if: ${{ inputs.build_v2 }} @@ -108,23 +108,26 @@ jobs: with: platforms: linux/arm64 - - name: Build Node.js V2 ARM64 musl (apk current mode) + - name: Build Node.js V2 ARM64 musl (apk lts mode) run: | - NODE_VER="23.2.0" + NODE_VER="24.14.1" mkdir -p dist - echo "=== Building Node.js v${NODE_VER}+ ARM64 musl (apk current mode) ===" + echo "=== Building Node.js v${NODE_VER} ARM64 musl (apk lts mode) ===" docker run --rm --platform linux/arm64 \ -v "$PWD/dist:/output" \ -v "$PWD/scripts/build-node-musl.sh:/build-node-musl.sh:ro" \ -e "NODE_VER=${NODE_VER}" \ -e "BUILD_MODE=apk" \ - -e "PKG_TYPE=current" \ - alpine:3.21 sh /build-node-musl.sh + -e "PKG_TYPE=lts" \ + alpine:edge sh /build-node-musl.sh - name: Build info id: build_info run: | + EXPECTED_ARTIFACT="node-v24.14.1-linux-arm64-musl.tar.xz" + test -f "dist/${EXPECTED_ARTIFACT}" ARTIFACT_NAME=$(ls dist/*.tar.xz | head -1 | xargs basename) + test "${ARTIFACT_NAME}" = "${EXPECTED_ARTIFACT}" echo "artifact_name=${ARTIFACT_NAME}" >> "$GITHUB_OUTPUT" echo "Artifact: ${ARTIFACT_NAME}" @@ -211,13 +214,13 @@ jobs: | 文件 | 版本 | 用途 | |------|------|------| - | `node-v23.2.0-linux-arm64-musl.tar.xz` | V2 (当前默认) | OpenClaw v2026.3.11+ (默认下载,满足 >= 22.16.0) | + | `node-v24.14.1-linux-arm64-musl.tar.xz` | V2 (当前默认) | OpenClaw v2026.3.11+ (默认下载,满足 >= 22.16.0) | | `node-v22.x.x-linux-arm64-musl.tar.xz` | V1 (旧版) | OpenClaw v2026.3.8 及更早版本 | ## 构建模式 两种版本均使用 **Alpine apk 模式** 构建: - - **V2**: 使用 Alpine `nodejs-current` 包 (v23.x),当前默认发布 `node-v23.2.0-linux-arm64-musl.tar.xz` + - **V2**: 使用 Alpine `edge` 的 `nodejs` LTS 包 (v24.x),当前默认发布 `node-v24.14.1-linux-arm64-musl.tar.xz` - **V1**: 使用 Alpine `nodejs` LTS 包 (v22.x),兼容旧版 OpenClaw `openclaw-env setup` 会在 ARM64 musl 设备上默认直连下载 V2 当前版本,必要时再回退到 Release 元数据解析。 diff --git a/root/usr/bin/openclaw-env b/root/usr/bin/openclaw-env index 0136c50..c09d453 100755 --- a/root/usr/bin/openclaw-env +++ b/root/usr/bin/openclaw-env @@ -15,9 +15,9 @@ set -e . /usr/libexec/openclaw-node.sh # ── Node.js 版本策略 ── -# V2: 当前推荐版本,用于 OpenClaw v2026.3.11+ (默认下载 23.2.0,满足 >= 22.16.0) +# V2: 当前推荐版本,用于 OpenClaw v2026.3.11+ (默认下载 24.14.1,满足 >= 22.16.0) # V1: 保留给显式指定旧版环境时使用,不再作为 V2 的自动回退 -NODE_VERSION_V2="23.2.0" +NODE_VERSION_V2="24.14.1" NODE_VERSION_V1="22.15.1" # 默认使用 V2 版本 (可通过 NODE_VERSION 环境变量覆盖) NODE_VERSION="${NODE_VERSION:-${NODE_VERSION_V2}}" diff --git a/tests/test_node_packaging_contract.sh b/tests/test_node_packaging_contract.sh index b0959a3..1da5878 100644 --- a/tests/test_node_packaging_contract.sh +++ b/tests/test_node_packaging_contract.sh @@ -28,7 +28,14 @@ grep -Fq 'verify_prefix /opt/openclaw/node' "$WORKFLOW" || fail "workflow should grep -Fq 'verify_prefix /tmp/custom-openclaw-root/openclaw/node' "$WORKFLOW" || fail "workflow should verify custom install path" grep -Fq 'oc_node_version_ge "$installed_ver" "$node_ver"' "$ENV_SCRIPT" || fail "installer should enforce minimum node version after extraction" -grep -Fq 'NODE_VERSION_V2="23.2.0"' "$ENV_SCRIPT" || fail "installer should default V2 to Node.js 23.2.0" +grep -Fq 'NODE_VERSION_V2="24.14.1"' "$ENV_SCRIPT" || fail "installer should default V2 to Node.js 24.14.1" +grep -Fq "description: 'Build V2 (24.14.1) - Current LTS version'" "$WORKFLOW" || fail "workflow should describe V2 as Node.js 24.14.1 LTS" +grep -Fq 'NODE_VER="24.14.1"' "$WORKFLOW" || fail "workflow should request Node.js 24.14.1 for V2" +grep -Fq 'Build Node.js V2 ARM64 musl (apk lts mode)' "$WORKFLOW" || fail "workflow should build V2 in apk lts mode" +grep -Fq 'PKG_TYPE=lts' "$WORKFLOW" || fail "workflow should use Alpine nodejs LTS package for V2" +grep -Fq 'alpine:edge sh /build-node-musl.sh' "$WORKFLOW" || fail "workflow should build V2 from Alpine edge to get the latest Node.js 24 LTS package" +grep -Fq 'EXPECTED_ARTIFACT="node-v24.14.1-linux-arm64-musl.tar.xz"' "$WORKFLOW" || fail "workflow should require the exact Node.js 24.14.1 V2 artifact name" +grep -Fq '`node-v24.14.1-linux-arm64-musl.tar.xz`' "$WORKFLOW" || fail "release notes should mention the Node.js 24.14.1 ARM64 musl tarball" if grep -Fq 'mirror_list="$mirror_list ${NODE_SELF_HOST}/${v1_tarball}"' "$ENV_SCRIPT"; then fail "installer should not auto-fallback from V2 to V1 tarball" fi diff --git a/tests/test_openclaw_node.sh b/tests/test_openclaw_node.sh index 663a217..afb9b50 100644 --- a/tests/test_openclaw_node.sh +++ b/tests/test_openclaw_node.sh @@ -18,10 +18,10 @@ if oc_normalize_node_version "broken-version" >/dev/null 2>&1; then fail "invalid version should not normalize" fi -oc_node_version_ge "23.2.0" "23.2.0" || fail "exact version should satisfy requirement" -oc_node_version_ge "23.2.1" "23.2.0" || fail "newer patch should satisfy requirement" -oc_node_version_ge "24.0.0" "23.2.0" || fail "newer major should satisfy requirement" -if oc_node_version_ge "22.15.1" "23.2.0"; then +oc_node_version_ge "24.14.1" "24.14.1" || fail "exact version should satisfy requirement" +oc_node_version_ge "24.14.2" "24.14.1" || fail "newer patch should satisfy requirement" +oc_node_version_ge "25.0.0" "24.14.1" || fail "newer major should satisfy requirement" +if oc_node_version_ge "24.14.0" "24.14.1"; then fail "older minor version should not satisfy requirement" fi @@ -71,8 +71,8 @@ cat > "$tmpdir/node-bins-release.json" <<'EOF' "browser_download_url": "https://github.com/hotwa/luci-app-openclaw/releases/download/node-bins/node-v22.15.1-linux-arm64-musl.tar.xz" }, { - "name": "node-v23.2.0-linux-arm64-musl.tar.xz", - "browser_download_url": "https://github.com/hotwa/luci-app-openclaw/releases/download/node-bins/node-v23.2.0-linux-arm64-musl.tar.xz" + "name": "node-v24.14.1-linux-arm64-musl.tar.xz", + "browser_download_url": "https://github.com/hotwa/luci-app-openclaw/releases/download/node-bins/node-v24.14.1-linux-arm64-musl.tar.xz" }, { "name": "node-v22.16.0-linux-x64-musl.tar.xz", @@ -82,25 +82,25 @@ cat > "$tmpdir/node-bins-release.json" <<'EOF' } EOF -selected_url=$(oc_select_node_release_asset_url "$tmpdir/node-bins-release.json" "linux-arm64" "23.2.0") || fail "select compatible ARM64 musl asset" -[ "$selected_url" = "https://github.com/hotwa/luci-app-openclaw/releases/download/node-bins/node-v23.2.0-linux-arm64-musl.tar.xz" ] || fail "selected asset should be newest compatible ARM64 musl release" +selected_url=$(oc_select_node_release_asset_url "$tmpdir/node-bins-release.json" "linux-arm64" "24.14.1") || fail "select compatible ARM64 musl asset" +[ "$selected_url" = "https://github.com/hotwa/luci-app-openclaw/releases/download/node-bins/node-v24.14.1-linux-arm64-musl.tar.xz" ] || fail "selected asset should be newest compatible ARM64 musl release" cat > "$tmpdir/gitea-node-bins-release.json" <<'EOF' { "tag_name": "node-bins", "assets": [ { - "name": "node-v23.2.0-linux-arm64-musl.tar.xz", - "browser_download_url": "http://100.64.0.27:8418/lingyuzeng/luci-app-openclaw/releases/download/node-bins/node-v23.2.0-linux-arm64-musl.tar.xz" + "name": "node-v24.14.1-linux-arm64-musl.tar.xz", + "browser_download_url": "http://100.64.0.27:8418/lingyuzeng/luci-app-openclaw/releases/download/node-bins/node-v24.14.1-linux-arm64-musl.tar.xz" } ] } EOF -gitea_selected_url=$(oc_select_node_release_asset_url "$tmpdir/gitea-node-bins-release.json" "linux-arm64" "23.2.0") || fail "select compatible ARM64 musl asset from Gitea release JSON" -[ "$gitea_selected_url" = "http://100.64.0.27:8418/lingyuzeng/luci-app-openclaw/releases/download/node-bins/node-v23.2.0-linux-arm64-musl.tar.xz" ] || fail "selected Gitea asset should preserve browser_download_url" +gitea_selected_url=$(oc_select_node_release_asset_url "$tmpdir/gitea-node-bins-release.json" "linux-arm64" "24.14.1") || fail "select compatible ARM64 musl asset from Gitea release JSON" +[ "$gitea_selected_url" = "http://100.64.0.27:8418/lingyuzeng/luci-app-openclaw/releases/download/node-bins/node-v24.14.1-linux-arm64-musl.tar.xz" ] || fail "selected Gitea asset should preserve browser_download_url" -if oc_select_node_release_asset_url "$tmpdir/node-bins-release.json" "linux-arm64" "24.0.0" >/dev/null 2>&1; then +if oc_select_node_release_asset_url "$tmpdir/node-bins-release.json" "linux-arm64" "24.14.2" >/dev/null 2>&1; then fail "asset selection should fail when no compatible version exists" fi