mirror of
https://github.com/hotwa/luci-app-openclaw.git
synced 2026-03-30 20:25:44 +00:00
release: v1.0.15 — QQBot 死锁修复、离线安装包、musl 架构支持
This commit is contained in:
136
.github/workflows/build.yml
vendored
136
.github/workflows/build.yml
vendored
@@ -4,14 +4,24 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: '版本号 (留空自动生成,格式: 1.0.0)'
|
||||
description: '版本号 (留空则读取 VERSION 文件)'
|
||||
required: false
|
||||
default: ''
|
||||
build_offline:
|
||||
description: '是否构建离线安装包 (~130MB/架构)'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
create_release:
|
||||
description: '是否创建 Release'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
upload_openlist:
|
||||
description: '是否上传到 OpenList 网盘'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -38,6 +48,17 @@ jobs:
|
||||
echo "tag=v$VER" >> "$GITHUB_OUTPUT"
|
||||
echo "Version: $VER"
|
||||
|
||||
- name: Extract build versions from source
|
||||
id: build_versions
|
||||
run: |
|
||||
# 从 openclaw-env 中提取版本号 (唯一的版本真相源)
|
||||
NODE_VER=$(grep -oP 'NODE_VERSION="\$\{NODE_VERSION:-\K[0-9.]+' root/usr/bin/openclaw-env)
|
||||
OC_VER=$(grep -oP 'OC_TESTED_VERSION="\K[0-9.]+' root/usr/bin/openclaw-env)
|
||||
echo "node_version=${NODE_VER}" >> "$GITHUB_OUTPUT"
|
||||
echo "oc_version=${OC_VER}" >> "$GITHUB_OUTPUT"
|
||||
echo "Node.js: v${NODE_VER}"
|
||||
echo "OpenClaw: v${OC_VER}"
|
||||
|
||||
- name: Inject version
|
||||
run: |
|
||||
VER="${{ steps.version.outputs.version }}"
|
||||
@@ -45,7 +66,9 @@ jobs:
|
||||
# 同步到 Makefile
|
||||
sed -i "s/^PKG_VERSION:=.*/PKG_VERSION:=$VER/" Makefile
|
||||
|
||||
- name: Build .run installer
|
||||
# ── 在线安装包 (始终构建) ──
|
||||
|
||||
- name: Build .run installer (online)
|
||||
run: |
|
||||
chmod +x scripts/build_run.sh
|
||||
sh scripts/build_run.sh dist
|
||||
@@ -55,19 +78,50 @@ jobs:
|
||||
chmod +x scripts/build_ipk.sh
|
||||
sh scripts/build_ipk.sh dist
|
||||
|
||||
# ── 离线安装包 (可选) ──
|
||||
|
||||
- name: Setup Node.js (for offline build)
|
||||
if: github.event.inputs.build_offline == 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Download offline dependencies
|
||||
if: github.event.inputs.build_offline == 'true'
|
||||
run: |
|
||||
chmod +x scripts/download_deps.sh
|
||||
sh scripts/download_deps.sh .offline-cache
|
||||
env:
|
||||
NODE_VERSION: ${{ steps.build_versions.outputs.node_version }}
|
||||
OC_VERSION: ${{ steps.build_versions.outputs.oc_version }}
|
||||
|
||||
- name: Build offline .run (musl only)
|
||||
if: github.event.inputs.build_offline == 'true'
|
||||
run: |
|
||||
chmod +x scripts/build_offline_run.sh
|
||||
sh scripts/build_offline_run.sh dist/
|
||||
env:
|
||||
CACHE_DIR: .offline-cache
|
||||
NODE_VERSION: ${{ steps.build_versions.outputs.node_version }}
|
||||
|
||||
# ── 通用步骤 ──
|
||||
|
||||
- name: List outputs
|
||||
run: ls -lh dist/
|
||||
run: |
|
||||
echo "=== Build artifacts ==="
|
||||
ls -lh dist/
|
||||
echo ""
|
||||
echo "=== SHA256 checksums ==="
|
||||
sha256sum dist/*.run dist/*.ipk 2>/dev/null || true
|
||||
|
||||
- name: Extract changelog
|
||||
id: changelog
|
||||
run: |
|
||||
VER="${{ steps.version.outputs.version }}"
|
||||
# 提取当前版本的 CHANGELOG 内容 (从 ## [version] 到下一个 ## [ 之间)
|
||||
CHANGELOG=$(awk "/^## \\[${VER}\\]/{found=1; next} /^## \\[/{if(found) exit} found{print}" CHANGELOG.md)
|
||||
if [ -z "$CHANGELOG" ]; then
|
||||
CHANGELOG="暂无更新日志"
|
||||
fi
|
||||
# 写入多行输出
|
||||
{
|
||||
echo "content<<CHANGELOG_EOF"
|
||||
echo "$CHANGELOG"
|
||||
@@ -79,56 +133,60 @@ jobs:
|
||||
with:
|
||||
name: luci-app-openclaw-${{ steps.version.outputs.version }}
|
||||
path: dist/*
|
||||
retention-days: 30
|
||||
compression-level: 0
|
||||
|
||||
- name: Upload to OpenList (online)
|
||||
if: github.event.inputs.upload_openlist == 'true'
|
||||
run: |
|
||||
chmod +x scripts/upload_openlist.sh
|
||||
sh scripts/upload_openlist.sh dist/
|
||||
env:
|
||||
OPENLIST_URL: ${{ secrets.OPENLIST_URL }}
|
||||
OPENLIST_USER: ${{ secrets.OPENLIST_USER }}
|
||||
OPENLIST_PASS: ${{ secrets.OPENLIST_PASS }}
|
||||
OPENLIST_PATH: ${{ secrets.OPENLIST_PATH }}
|
||||
UPLOAD_MODE: online
|
||||
|
||||
- name: Upload to OpenList (offline)
|
||||
if: github.event.inputs.upload_openlist == 'true' && github.event.inputs.build_offline == 'true'
|
||||
run: |
|
||||
sh scripts/upload_openlist.sh dist/
|
||||
env:
|
||||
OPENLIST_URL: ${{ secrets.OPENLIST_URL }}
|
||||
OPENLIST_USER: ${{ secrets.OPENLIST_USER }}
|
||||
OPENLIST_PASS: ${{ secrets.OPENLIST_PASS }}
|
||||
OPENLIST_PATH: ${{ secrets.OPENLIST_PATH }}
|
||||
UPLOAD_MODE: offline
|
||||
|
||||
- name: Create Release
|
||||
if: ${{ github.event.inputs.create_release == 'true' }}
|
||||
if: github.event.inputs.create_release == 'true'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ steps.version.outputs.tag }}
|
||||
name: luci-app-openclaw ${{ steps.version.outputs.tag }}
|
||||
name: ${{ steps.version.outputs.version }}
|
||||
files: dist/*
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: |
|
||||
## luci-app-openclaw ${{ steps.version.outputs.tag }}
|
||||
|
||||
OpenClaw AI 网关的 OpenWrt LuCI 管理插件。
|
||||
|
||||
### 更新日志
|
||||
|
||||
${{ steps.changelog.outputs.content }}
|
||||
|
||||
### 下载说明
|
||||
---
|
||||
|
||||
| 文件 | 说明 |
|
||||
|------|------|
|
||||
| `luci-app-openclaw_*.run` | 自解压安装包,适用于已运行的 OpenWrt / iStoreOS 系统 |
|
||||
| `luci-app-openclaw_*.ipk` | 标准 opkg 安装包 |
|
||||
|
||||
### 安装方法
|
||||
|
||||
**方式一:.run 安装包(推荐)**
|
||||
```bash
|
||||
# 上传到路由器后执行
|
||||
sh luci-app-openclaw_${{ steps.version.outputs.version }}.run
|
||||
**在线安装** (需联网,自动下载 Node.js + OpenClaw)
|
||||
```
|
||||
# iStoreOS
|
||||
sh luci-app-openclaw_${{ steps.version.outputs.version }}.run
|
||||
|
||||
**方式二:.ipk 安装**
|
||||
```bash
|
||||
# OpenWrt
|
||||
opkg install luci-app-openclaw_${{ steps.version.outputs.version }}-1_all.ipk
|
||||
```
|
||||
|
||||
### 安装后使用
|
||||
**离线安装** (无需联网,包含全部依赖)
|
||||
```bash
|
||||
# 将对应架构的 *_offline.run 传到路由器
|
||||
scp luci-app-openclaw_*_offline.run root@路由器IP:/tmp/
|
||||
ssh root@路由器IP "sh /tmp/luci-app-openclaw_*_offline.run"
|
||||
```
|
||||
|
||||
1. 打开 LuCI → 服务 → OpenClaw
|
||||
2. 点击「安装运行环境」,等待安装完成后服务会自动启动
|
||||
3. 进入「Web 控制台」添加 AI 模型的 API Key 即可使用
|
||||
|
||||
### 兼容性
|
||||
|
||||
- 系统:OpenWrt / iStoreOS / ImmortalWrt / KWRT 23.05+
|
||||
- 架构:x86_64、aarch64
|
||||
- C 库:glibc、musl(自动识别)
|
||||
|
||||
---
|
||||
[使用文档](https://github.com/10000ge10000/luci-app-openclaw#readme) · [问题反馈](https://github.com/10000ge10000/luci-app-openclaw/issues) · [B站](https://space.bilibili.com/59438380) · [博客](https://blog.910501.xyz/)
|
||||
|
||||
Reference in New Issue
Block a user