Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66d3801e43 | |||
| 973547b6fb | |||
| edaac8aa45 | |||
| 157f51c765 | |||
| d54a69cba8 | |||
| 3b6f15ecbb | |||
| cd131697d5 | |||
| 2e3ac2cfe7 | |||
| bea22d5e9e | |||
| 7759e0b376 | |||
| 92a9d61007 | |||
| 16b3f50dac | |||
| 48c6bec254 | |||
| 9e7369a2af | |||
| bad0846cc3 |
71
.github/workflows/release_skill.yaml
vendored
71
.github/workflows/release_skill.yaml
vendored
@@ -1,70 +1,11 @@
|
||||
name: 技能自动化发布 (测试版-无鉴权)
|
||||
name: 技能自动化发布
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 1. 下载源码
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# 2. 环境及工具准备
|
||||
- name: Setup Tools
|
||||
run: pip install pyarmor requests python-frontmatter
|
||||
|
||||
# 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. 提取元数据并物理打包
|
||||
- name: Parse Metadata and Pack
|
||||
id: build_task
|
||||
run: |
|
||||
python -c "
|
||||
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 包
|
||||
shutil.make_archive(slug, 'zip', 'dist/package')
|
||||
"
|
||||
|
||||
# 5. 同步数据库记录 (对应接口: /api/skill/update)
|
||||
- name: Sync Database (V2.0)
|
||||
run: |
|
||||
python -c "
|
||||
import requests, json
|
||||
metadata = json.loads('${{ steps.build_task.outputs.metadata }}')
|
||||
# 严谨修正:接口路径为 /api/skill/update
|
||||
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)
|
||||
"
|
||||
|
||||
# 6. 上传物理包 (对应接口: /api/upload)
|
||||
- name: Upload Encrypted ZIP
|
||||
run: |
|
||||
SLUG=${{ steps.build_task.outputs.slug }}
|
||||
VERSION=${{ steps.build_task.outputs.version }}
|
||||
python -c "
|
||||
import requests
|
||||
url = 'https://jc2009.com/api/upload'
|
||||
payload = {'plugin_name': '$SLUG', 'version': '$VERSION'}
|
||||
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)
|
||||
"
|
||||
release:
|
||||
uses: admin/jiangchang-platform-kit/.github/workflows/reusable-release-skill.yaml@main
|
||||
with:
|
||||
artifact_platform: windows
|
||||
pyarmor_platform: windows.x86_64
|
||||
39
SKILL.md
39
SKILL.md
@@ -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>
|
||||
23
release.ps1
Normal file
23
release.ps1
Normal file
@@ -0,0 +1,23 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$Prefix = "v",
|
||||
[string]$Message = "正式发布",
|
||||
[switch]$AutoCommit,
|
||||
[switch]$RequireClean,
|
||||
[string]$CommitMessage,
|
||||
[switch]$DryRun
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$sharedScript = Join-Path $scriptDir "..\jiangchang-platform-kit\tools\release.ps1"
|
||||
$sharedScript = [System.IO.Path]::GetFullPath($sharedScript)
|
||||
|
||||
if (-not (Test-Path $sharedScript)) {
|
||||
throw "Shared release script not found: $sharedScript"
|
||||
}
|
||||
|
||||
& $sharedScript @PSBoundParameters
|
||||
exit $LASTEXITCODE
|
||||
Reference in New Issue
Block a user