From 78bd6c2e9d9ceb77f716de058d21d752b5c9b523 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 14 Jul 2026 13:17:21 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E6=89=A7=E8=A1=8C=E5=99=A8=20steps/params=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=20(#16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Workflow-规范.md: 添加 type: python 字段 - TOOLS.md: 添加 type: python 到示例 - 套件发布指南.md: 更新为 upload 端点 + tar.gz 上传方式 + 完整示例 - CLI-参考.md: gis-actions 版本 3.0.2 → 3.0.5 --- suite-developer/TOOLS.md | 1 + suites-help/SDK参考/CLI-参考.md | 4 +-- suites-help/开发者指南/Workflow-规范.md | 2 ++ suites-help/开发者指南/套件发布指南.md | 48 +++++++++++++++++-------- 4 files changed, 39 insertions(+), 16 deletions(-) diff --git a/suite-developer/TOOLS.md b/suite-developer/TOOLS.md index b31877b..16ae00f 100644 --- a/suite-developer/TOOLS.md +++ b/suite-developer/TOOLS.md @@ -60,6 +60,7 @@ base_image: gis-base:latest steps: - id: step1 name: 步骤名称 + type: python script_id: run params: input: $params.input_path diff --git a/suites-help/SDK参考/CLI-参考.md b/suites-help/SDK参考/CLI-参考.md index fc7546b..b9a187d 100644 --- a/suites-help/SDK参考/CLI-参考.md +++ b/suites-help/SDK参考/CLI-参考.md @@ -5,8 +5,8 @@ `agc` 命令随 gis-actions 包一起安装: ```bash -curl -sLO https://git.mercator.cn/api/packages/AgentGIS/generic/gis-actions/3.0.2/gis-actions_3.0.2_all.deb -sudo dpkg -i gis-actions_3.0.2_all.deb +curl -sLO https://git.mercator.cn/api/packages/AgentGIS/generic/gis-actions/3.0.5/gis-actions_3.0.5_all.deb +sudo dpkg -i gis-actions_3.0.5_all.deb ``` 安装后直接使用 `agc` 命令。 diff --git a/suites-help/开发者指南/Workflow-规范.md b/suites-help/开发者指南/Workflow-规范.md index c588dfd..1a26110 100644 --- a/suites-help/开发者指南/Workflow-规范.md +++ b/suites-help/开发者指南/Workflow-规范.md @@ -32,6 +32,7 @@ env: steps: - id: step1 name: 步骤名称 + type: python script_id: run params: input: $params.input_path @@ -55,6 +56,7 @@ steps: |------|------|------| | `id` | ✅ | 步骤唯一 ID | | `name` | ❌ | 步骤显示名称 | +| `type` | ✅ | 步骤类型,当前固定为 `python` | | `script_id` | ✅ | 脚本 ID(对应 scripts/ 下的 .py 文件名,不含扩展名) | | `params` | ❌ | 步骤参数,值中使用 `$params.xxx` 引用用户输入 | | `depends_on` | ❌ | 依赖的步骤 ID 列表,控制执行顺序 | diff --git a/suites-help/开发者指南/套件发布指南.md b/suites-help/开发者指南/套件发布指南.md index 4991459..a0adb81 100644 --- a/suites-help/开发者指南/套件发布指南.md +++ b/suites-help/开发者指南/套件发布指南.md @@ -8,23 +8,43 @@ ## 通过 API 发布 ```bash -curl -X POST https://suites.mercator.cn/api/v1/publish \ +curl -X POST https://suites.mercator.cn/api/v1/publish/upload \ -H "Authorization: Bearer mk_xxxx" \ - -H "Content-Type: application/json" \ - -d '{ - "name": "my-suite", - "version": "1.0.0", - "description": "我的套件", - "workflow_yaml": "name: my-suite\nversion: 1.0.0\nsteps: ...", - "scripts": {"run.py": "#!/usr/bin/env python3\n..."} - }' + -F "file=@my-suite.tar.gz" ``` -## 发布流程 +其中 `my-suite.tar.gz` 包含: ``` -1. 提交 workflow.yaml + scripts/ 内容 -2. 系统自动校验格式 -3. 校验通过 → 打包上传到 Gitea Packages -4. 在数据库中注册套件记录 +my-suite/ +├── workflow.yaml +└── scripts/ + └── run.py +``` + +`workflow.yaml` 示例: + +```yaml +name: my-suite +description: 我的套件 +version: 1.0.0 +author: 作者 +tags: [gis] +category: general + +params: + input_path: + type: string + required: true + desc: 输入文件路径 + +base_image: gis-base:latest + +steps: + - id: step1 + name: 处理步骤 + type: python + script_id: run + params: + input_path: $params.input_path ```