Skip to content

检测工作引擎版本更新 #106

检测工作引擎版本更新

检测工作引擎版本更新 #106

name: 检测工作引擎版本更新
on:
schedule:
# 每天 UTC 08:00(北京时间 16:00)
- cron: '0 8 * * *'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
# ──────────────────────────────────────────────
# OpenClaw — npm registry
# ──────────────────────────────────────────────
check-openclaw:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: 读取当前版本
id: current
run: |
VERSION=$(sed -n 's/^ARG OPENCLAW_VERSION=//p' nodeskclaw-artifacts/openclaw-image/Dockerfile)
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "当前版本: ${VERSION}"
- name: 查询 npm 最新稳定版
id: latest
run: |
LATEST=$(npm view openclaw versions --json 2>/dev/null | node -e "
const versions = JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf8'));
const stable = versions.filter(v => /^\d{4}\.\d{1,2}\.\d{1,2}$/.test(v));
if (stable.length > 0) console.log(stable[stable.length - 1]);
")
echo "version=${LATEST}" >> "$GITHUB_OUTPUT"
echo "最新稳定版: ${LATEST}"
- name: 对比版本
id: compare
run: |
if [ "${{ steps.current.outputs.version }}" = "${{ steps.latest.outputs.version }}" ]; then
echo "needs_update=false" >> "$GITHUB_OUTPUT"
echo "已是最新版本,无需更新"
else
echo "needs_update=true" >> "$GITHUB_OUTPUT"
echo "发现新版本: ${{ steps.current.outputs.version }} -> ${{ steps.latest.outputs.version }}"
fi
- name: 更新 Dockerfile
if: steps.compare.outputs.needs_update == 'true'
env:
CURRENT: ${{ steps.current.outputs.version }}
LATEST: ${{ steps.latest.outputs.version }}
run: |
sed -i "s/ARG OPENCLAW_VERSION=${CURRENT}/ARG OPENCLAW_VERSION=${LATEST}/" nodeskclaw-artifacts/openclaw-image/Dockerfile
sed -i "s/ARG IMAGE_VERSION=v${CURRENT}/ARG IMAGE_VERSION=v${LATEST}/" nodeskclaw-artifacts/openclaw-image/Dockerfile
echo "Dockerfile 已更新"
grep -E 'ARG (OPENCLAW_VERSION|IMAGE_VERSION)=' nodeskclaw-artifacts/openclaw-image/Dockerfile
- name: 获取 CHANGELOG 摘要
if: steps.compare.outputs.needs_update == 'true'
id: changelog
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
BODY=$(gh api repos/openclaw/openclaw/releases/tags/v${{ steps.latest.outputs.version }} --jq '.body // "无 Release Notes"' 2>/dev/null || echo "无法获取 Release Notes")
BODY="${BODY:0:2000}"
{
echo "body<<CHANGELOG_EOF"
echo "$BODY"
echo "CHANGELOG_EOF"
} >> "$GITHUB_OUTPUT"
- name: 创建 Pull Request
if: steps.compare.outputs.needs_update == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PAT_TOKEN }}
branch: chore/openclaw-${{ steps.latest.outputs.version }}
commit-message: "chore(openclaw): 升级 OpenClaw 至 ${{ steps.latest.outputs.version }}"
title: "chore(openclaw): 升级 OpenClaw 至 ${{ steps.latest.outputs.version }}"
body: |
## OpenClaw 版本更新
| 项目 | 值 |
|------|-----|
| 当前版本 | `${{ steps.current.outputs.version }}` |
| 最新版本 | `${{ steps.latest.outputs.version }}` |
| Release | https://github.com/openclaw/openclaw/releases/tag/v${{ steps.latest.outputs.version }} |
### CHANGELOG 摘要
<details><summary>展开查看</summary>
${{ steps.changelog.outputs.body }}
</details>
### 集成面检查清单
对照 `ee/docs/OpenClaw集成面清单.md`,逐项确认新版本兼容性:
- [ ] **配置 Schema** — `openclaw.json` Zod strict schema 是否接受我们写入的全部字段
- [ ] **文件系统路径** — `/root/.openclaw/` 目录结构是否变更
- [ ] **Session 文件格式** — `sessions.json` / `.jsonl` 结构是否变更
- [ ] **Channel Plugin SDK** — `openclaw/plugin-sdk` API 是否有 breaking change
- [ ] **Gateway 协议** — 端口 (18789/9721)、`/healthz`、认证方式是否变更
- [ ] **CLI 行为** — `openclaw gateway` 参数是否变更
- [ ] **Gene/Skill 注入** — `SKILL.md` 格式、`extraDirs` 机制是否变更
- [ ] **安全管道** — `tools.exec.*` 配置项、Security WebSocket 协议是否变更
- [ ] **镜像验证** — `./verify.sh <image:tag>` 全部 PASS
---
**此 PR 由 GitHub Actions 自动创建。**
合并后请:
1. 构建新镜像:`./build.sh openclaw --version ${{ steps.latest.outputs.version }}`
2. 运行验证:`./verify.sh <image:tag>`
3. 在引擎版本管理中发布新版本
labels: |
dependencies