Skip to content

Commit f9fc7fc

Browse files
committed
docs: add marketplace automation guide
1 parent 0931653 commit f9fc7fc

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ napgram-plugin-template/
161161
├── scripts/
162162
│ ├── pack.mjs # 打包脚本
163163
│ └── marketplace-snippet.mjs
164+
│ └── marketplace-upsert.mjs
164165
├── napgram-plugin.json # 插件元信息
165166
├── package.json
166167
├── tsconfig.json
@@ -174,6 +175,19 @@ napgram-plugin-template/
174175
3. 生成索引片段:`pnpm marketplace:snippet`
175176
4. 提交 PR 到 NapGram Marketplace 仓库
176177

178+
### 自动化发布(推荐)
179+
180+
打 tag 后 Release workflow 会自动:
181+
1. 打包产物并生成 `marketplace-index-snippet.json`
182+
2. 若配置了 `MARKETPLACE_PR_TOKEN`,自动向 marketplace 提交 PR(你负责合并)
183+
184+
需要在**实际插件仓库**配置以下 Secrets:
185+
- `NPM_TOKEN`:npm automation token(用于 publish)
186+
- `MARKETPLACE_PR_TOKEN`:GitHub PAT(公开仓库用 `public_repo` 即可)
187+
188+
可选配置:
189+
- `MARKETPLACE_DIST_HOST`:自定义资源下载域名,未设置时默认使用 GitHub Release 下载链接
190+
177191
## 示例插件
178192

179193
查看 `src/index.ts` 中的 Ping Pong 插件示例。

0 commit comments

Comments
 (0)