Compare commits

...

2 Commits

Author SHA1 Message Date
2e3ac2cfe7 feat: separate skill display name from slug
All checks were successful
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Successful in 11s
Set SKILL name to Chinese display text and add openclaw.slug for stable machine identifier, so database records can keep readable names while preserving stable install path keys.

Made-with: Cursor
2026-03-24 16:24:09 +08:00
bea22d5e9e ci: enforce tag-based version and strict sync checks
Use Git tag as release version, validate SKILL.md version consistency, and fail workflow when API business code is not success.
2026-03-24 16:14:06 +08:00
2 changed files with 39 additions and 6 deletions

View File

@@ -30,8 +30,26 @@ jobs:
import frontmatter, os, json, shutil
post = frontmatter.load('SKILL.md')
metadata = post.metadata
slug = metadata['name']
version = metadata['version']
# slug 优先从 openclaw.slug 读取,兼容历史用 name
openclaw_meta = metadata.get('metadata', {}).get('openclaw', {})
slug = (openclaw_meta.get('slug') or metadata.get('slug') or metadata.get('name') or '').strip()
if not slug:
raise Exception('SKILL.md 缺少 slug/name无法构建发布包')
# 以 Git Tag 为准(严格模式)
ref_name = (os.environ.get('GITHUB_REF_NAME') or '').strip()
if not ref_name:
ref_name = (os.environ.get('GITHUB_REF') or '').strip().split('/')[-1]
if not ref_name.startswith('v'):
raise Exception(f'非法标签: {ref_name},要求以 v 开头,例如 v1.0.10')
version = ref_name.lstrip('v')
skill_version = str(metadata.get('version') or '').strip()
if skill_version != version:
raise Exception(f'SKILL.md 版本({skill_version})与 Git Tag 版本({version})不一致')
# 统一覆盖,确保后续输出与上传完全一致
metadata['version'] = version
# 安全写入输出
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write(f'slug={slug}\n')
@@ -53,7 +71,14 @@ jobs:
url = 'https://jc2009.com/api/skill/update'
res = requests.post(url, json=metadata)
print(f'DB Sync Result: {res.text}')
if res.status_code != 200: exit(1)
if res.status_code != 200:
exit(1)
try:
payload = res.json()
except Exception:
exit(1)
if payload.get('code') != 200:
exit(1)
"
# 6. 上传物理包
@@ -71,5 +96,12 @@ jobs:
with open(f'{slug}.zip', 'rb') as f:
res = requests.post(url, data=payload, files={'file': f})
print(f'Upload Result: {res.text}')
if res.status_code != 200: exit(1)
if res.status_code != 200:
exit(1)
try:
payload = res.json()
except Exception:
exit(1)
if payload.get('code') != 200:
exit(1)
"

View File

@@ -1,10 +1,11 @@
---
name: account-manager
name: 账号管理
description: 多平台多账号管理。管理各平台账号与Chrome Profile的对应关系供publisher类Skill调用获取账号信息。
version: 1.0.1
author: 深圳匠厂科技有限公司
metadata:
openclaw:
slug: account-manager
emoji: "👤"
category: "通用"
skill_type: 1
@@ -14,7 +15,7 @@ allowed-tools:
- bash
---
# 账号管理
# 账号管理
## 使用时机