# 套件发布指南 ## 前置条件 - 一个 API Key(从 https://auth.mercator.cn 获取) - 套件目录包含 `workflow.yaml` 和 `scripts/` ## 通过 API 发布 ```bash curl -X POST https://suites.mercator.cn/api/v1/publish \ -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..."} }' ``` ## 发布流程 ``` 1. 提交 workflow.yaml + scripts/ 内容 2. 系统自动校验格式 3. 校验通过 → 打包上传到 Gitea Packages 4. 在数据库中注册套件记录 ```