版本更新:自动化 Rust 版本管理与 CI/CD - Openclaw Skills

作者:互联网

2026-04-14

AI教程

什么是 ralph-orchestrator 版本更新?

此技能为管理 ralph-orchestrator 项目的新版本提供了标准化的工作流。它专注于通过更新根目录 Cargo.toml 中的版本字符串来保持 Rust 工作区的一致性,确保内部依赖关系对齐,并通过 git 标签触发自动化 CI/CD 流水线。通过在 Openclaw Skills 中利用此技能,开发人员可以最大限度地减少发布周期中的手动错误,并确保在发布前所有内部 crate 都已同步。

该技能简化了手动寻找版本字符串这一重复且易出错的过程。它通过执行严格的构建、测试和打标签顺序,协调从开发到生产的过渡。这确保了通过 Openclaw Skills 发布的所有版本都符合项目的质量标准和基础设施要求。

下载入口:https://github.com/openclaw/skills/tree/main/skills/paulpete/release-bump

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install release-bump

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 release-bump。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

ralph-orchestrator 版本更新 应用场景

  • 在单个 Rust 工作区中跨多个 crate 升级版本号。
  • 为 ralph-core 和 ralph-cli 等 ralph-orchestrator 组件同步内部依赖版本。
  • 触发 GitHub Actions 进行自动化二进制构建和多平台分发。
  • 自动化向 crates.io 和 npm 等外部注册表的发布过程。
ralph-orchestrator 版本更新 工作原理
  1. 识别根工作区 Cargo.toml 中的当前版本和目标版本。
  2. 使用编辑工具同时替换 Cargo.toml 中所有七处出现的版本字符串。
  3. 执行 cargo build 以刷新 Cargo.lock 文件并验证工作区是否仍然有效。
  4. 使用 cargo test 运行完整的测试套件,以确保没有引入回归。
  5. 提交版本更改并将更新推送到主分支。
  6. 创建并推送语义化 git 标签 (vX.Y.Z) 以启动自动化 CI/CD 发布工作流。

ralph-orchestrator 版本更新 配置指南

为了准备在 Openclaw Skills 生态系统中使用此技能的环境,请确保您拥有功能齐全的 Rust 工具链和对存储库的 git 访问权限。

# 验证本地环境
cargo --version
git status

# 执行构建和测试的空运行
cargo build
cargo test

除了用于将标签推送到源服务器的标准 git 身份验证之外,不需要其他配置。

ralph-orchestrator 版本更新 数据架构与分类体系

该技能主要与项目配置和版本控制系统交互,以维护发布的完整性。

数据点 位置 / 格式 用途
工作区版本 Cargo.toml 定义所有 crate 的全局版本。
内部依赖 Cargo.toml 将 crate 关系映射到当前版本。
Git 标签 refs/tags/v* 用作 GitHub Release 工作流的触发器。
构建产物 target/ 在验证步骤中生成以确保稳定性。
name: release-bump
description: Use when bumping ralph-orchestrator version for a new release, after fixes are committed and ready to publish

Release Bump

Overview

Bump version and trigger release for ralph-orchestrator. All versions live in workspace Cargo.toml - individual crates inherit via version.workspace = true.

Confirm the new version with the user. Once the bump commit is pushed, track progress of the release.

Quick Reference

Step Command/Action
1. Bump version Edit Cargo.toml: replace all version = "X.Y.Z" (7 occurrences)
2. Build cargo build (updates Cargo.lock)
3. Test cargo test
4. Commit git add Cargo.toml Cargo.lock && git commit -m "chore: bump to vX.Y.Z"
5. Push git push origin main
6. Tag git tag vX.Y.Z && git push origin vX.Y.Z

Version Locations (All in Cargo.toml)

# Line ~17 - workspace version
[workspace.package]
version = "X.Y.Z"

# Lines ~113-118 - internal crate dependencies
ralph-proto = { version = "X.Y.Z", path = "crates/ralph-proto" }
ralph-core = { version = "X.Y.Z", path = "crates/ralph-core" }
ralph-adapters = { version = "X.Y.Z", path = "crates/ralph-adapters" }
ralph-tui = { version = "X.Y.Z", path = "crates/ralph-tui" }
ralph-cli = { version = "X.Y.Z", path = "crates/ralph-cli" }
ralph-bench = { version = "X.Y.Z", path = "crates/ralph-bench" }

Tip: Use Edit tool with replace_all: true on version = "OLD"version = "NEW" to update all 7 at once.

What CI Does Automatically

Once you push the tag, .github/workflows/release.yml triggers and:

  1. Creates the GitHub Release with auto-generated notes
  2. Builds binaries for macOS (arm64, x64) and Linux (arm64, x64)
  3. Uploads artifacts to the GitHub Release
  4. Publishes to crates.io (in dependency order)
  5. Publishes to npm as @ralph-orchestrator/ralph

Common Mistakes

Mistake Fix
Only updating workspace.package.version Must update all 7 occurrences including internal deps
Forgetting to run tests Always cargo test before commit
Creating release manually with gh release create Just push the tag - CI creates the release with artifacts
Pushing tag before main Push main first, then push the tag