From f864cb3737f9ea4209ac41dfb4478c7b0c7880d3 Mon Sep 17 00:00:00 2001 From: Huawei Date: Thu, 9 Jul 2026 15:10:28 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20suites-help/=E5=BC=80=E5=8F=91=E8=80=85?= =?UTF-8?q?=E6=8C=87=E5=8D=97/=E5=A5=97=E4=BB=B6=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=8C=87=E5=8D=97.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suites-help/开发者指南/套件发布指南.md | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 suites-help/开发者指南/套件发布指南.md diff --git a/suites-help/开发者指南/套件发布指南.md b/suites-help/开发者指南/套件发布指南.md new file mode 100644 index 0000000..baabc37 --- /dev/null +++ b/suites-help/开发者指南/套件发布指南.md @@ -0,0 +1,63 @@ +# 套件发布指南 + +## 前置条件 + +- 一个 API Key(从 https://auth.mercator.cn 获取) +- 套件目录包含 `workflow.yaml` 和 `scripts/` + +## 一、使用 CLI 发布(推荐) + +```bash +# 安装 CLI +pip install agentgis-cli + +# 配置 API Key +agc config set api-key mk_xxxxxxxxxxxxx + +# 发布 +agc publish ./my-suite +``` + +## 二、手动发布 + +### 1. 打包 + +```bash +cd my-suite +tar czf scripts.tar.gz workflow.yaml scripts/ +``` + +### 2. 上传到包存储 + +```bash +curl -X PUT \ + -H "Authorization: Bearer mk_xxxx" \ + -F "file=@scripts.tar.gz" \ + https://suites.mercator.cn/api/v1/publish/upload +``` + +### 3. 注册套件 + +```bash +curl -X POST https://suites.mercator.cn/api/v1/suites \ + -H "Authorization: Bearer mk_xxxx" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "my-suite", + "description": "我的套件", + "version": "1.0.0", + "workflow": { ... }, + "package_url": "https://..." + }' +``` + +## 合规检测 + +发布时自动检测: + +- `workflow.yaml` 格式是否正确 +- 参数声明是否完整 +- 脚本文件是否存在 +- 参数类型是否匹配 + +不通过则发布失败,返回具体错误信息。