Compare commits

...

9 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
7759e0b376 fix: add required openclaw metadata for skill sync
All checks were successful
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Successful in 12s
Include category and pricing-related openclaw metadata in SKILL frontmatter so /api/skill/update validation can pass during CI sync.

Made-with: Cursor
2026-03-24 15:55:39 +08:00
92a9d61007 ci: use mirrored checkout action
All checks were successful
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Successful in 11s
Switch workflow checkout step to internal Gitea mirrored actions-checkout to reduce external GitHub dependency and speed up setup.

Made-with: Cursor
2026-03-24 15:09:02 +08:00
16b3f50dac ci: set artifact_type=skill for release upload
All checks were successful
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Successful in 14s
2026-03-24 14:20:34 +08:00
48c6bec254 chore: 使用清华源加速 pip 安装
All checks were successful
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Successful in 11s
2026-03-24 11:47:12 +08:00
9e7369a2af fix: 使用环境变量传递数据以修复 Python 解析错误
Some checks failed
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Failing after 1m31s
2026-03-24 11:38:20 +08:00
bad0846cc3 fix: 修复 pip 安装限制并升级变量输出语法
Some checks failed
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Failing after 15s
2026-03-24 11:35:33 +08:00
721442315f fix: 修复 YAML 文件编码为 UTF-8
Some checks failed
技能自动化发布 (测试版-无鉴权) / build-and-deploy (push) Failing after 1m31s
2026-03-24 11:30:41 +08:00
2 changed files with 73 additions and 59 deletions

View File

@@ -1,4 +1,4 @@
name: 技能自动化发布 (测试版-无鉴权)
name: 技能自动化发布 (测试版-无鉴权)
on:
push:
tags: ["v*"]
@@ -7,23 +7,22 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# 1. 下载源码
- uses: actions/checkout@v3
# 1. 下载源码
- uses: http://120.25.191.12:3000/admin/actions-checkout@v4
# 2. 环境及工具准备
# 2. 环境及工具准备
- name: Setup Tools
run: pip install pyarmor requests python-frontmatter
# 优化:使用国内清华源加速安装速度
run: pip install pyarmor requests python-frontmatter --break-system-packages -i https://pypi.tuna.tsinghua.edu.cn/simple
# 3. 【核心步骤】PyArmor 源代码混淆加密
# 3. 【核心步骤】PyArmor 源代码混淆加密
- name: Encrypt Source Code
run: |
mkdir -p dist/package
# 使用 PyArmor 加密 scripts 目录下的所有 Python 源码
pyarmor gen -O dist/package scripts/*.py
# 拷贝说明文档到发包目录
cp SKILL.md dist/package/
# 4. 提取元数据并物理打包
# 4. 提取元数据并物理打包
- name: Parse Metadata and Pack
id: build_task
run: |
@@ -31,40 +30,78 @@ jobs:
import frontmatter, os, json, shutil
post = frontmatter.load('SKILL.md')
metadata = post.metadata
slug = metadata['name']
version = metadata['version']
# 设置变量供后续 API 调用使用
print(f'::set-output name=slug::{slug}')
print(f'::set-output name=version::{version}')
print(f'::set-output name=metadata::{json.dumps(metadata)}')
# 制作最终的发布 ZIP 包
# 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')
f.write(f'version={version}\n')
f.write(f'metadata={json.dumps(metadata)}\n')
# 制作最终的发布 ZIP 包
shutil.make_archive(slug, 'zip', 'dist/package')
"
# 5. 同步数据库记录 (对应接口: /api/skill/update)
# 5. 同步数据库记录
- name: Sync Database (V2.0)
env:
METADATA_JSON: ${{ steps.build_task.outputs.metadata }}
run: |
python -c "
import requests, json
metadata = json.loads('${{ steps.build_task.outputs.metadata }}')
# 严谨修正:接口路径为 /api/skill/update
import requests, json, os
metadata = json.loads(os.environ['METADATA_JSON'])
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. 上传物理包 (对应接口: /api/upload)
# 6. 上传物理包
- name: Upload Encrypted ZIP
env:
SLUG: ${{ steps.build_task.outputs.slug }}
VERSION: ${{ steps.build_task.outputs.version }}
run: |
SLUG=${{ steps.build_task.outputs.slug }}
VERSION=${{ steps.build_task.outputs.version }}
python -c "
import requests
import requests, os
url = 'https://jc2009.com/api/upload'
payload = {'plugin_name': '$SLUG', 'version': '$VERSION'}
with open(f'$SLUG.zip', 'rb') as f:
slug = os.environ['SLUG']
version = os.environ['VERSION']
payload = {'plugin_name': slug, 'version': version, 'artifact_type': 'skill'}
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,16 +1,21 @@
---
name: account-manager
name: 账号管理
description: 多平台多账号管理。管理各平台账号与Chrome Profile的对应关系供publisher类Skill调用获取账号信息。
version: 1.0.1
author: 深圳匠厂科技有限公司
metadata:
openclaw:
slug: account-manager
emoji: "👤"
category: "通用"
skill_type: 1
monthly_price: 0
yearly_price: 0
allowed-tools:
- bash
---
# 账号管理
# 账号管理
## 使用时机
@@ -23,32 +28,4 @@ allowed-tools:
### 列出某平台所有账号
```bash
python3 {baseDir}/scripts/account.py list <platform>
```
### 获取某个账号详情
```bash
python3 {baseDir}/scripts/account.py get <account_id>
```
### 初始化账号登录(首次使用,打开浏览器手动登录)
```bash
python3 {baseDir}/scripts/account.py login <account_id>
```
## 输出格式
- list逐行返回账号ID和名称
- get返回账号完整信息
- login打开浏览器后提示用户手动完成登录
## 错误处理
- 账号不存在:提示"未找到该账号请检查账号ID是否正确"
- 平台无账号:提示"该平台暂无账号请先在accounts.json中添加"
## 注意事项
- 账号档案存储在 `accounts.json`,新增账号需手动编辑该文件
- Chrome Profile目录首次登录后自动创建登录态永久保存
- 每个账号只需初始化登录一次
python3 {baseDir}/scripts/account.py list <platform>