logo
0
0
WeChat Login

JetBrains Marketplace → CNB Releases

plugins.yml 解析插件名称,通过 JetBrains Marketplace API 获取最新版本并下载,再上传到 CNB Release。

流程

plugins.yml ──fetch.sh──▶ fetch.json ──download.sh──▶ downloads/ + download.json ──upload.sh──▶ CNB Release

依赖

  • yq (mikefarah/yq v4+)
  • jq
  • curl
  • bash
brew install yq jq

文件说明

文件作用
plugins.yml输入:产品类型 + 插件显示名列表
fetch.sh调用 JetBrains API,解析 pluginId / updateId / filename,输出 fetch.json
download.sh根据 fetch.json 下载插件包到 downloads/,输出 download.json
upload.shdownloads/ 下载产物上传到 CNB Release(按文件增量:删旧→传新)
run.sh一键串联 fetch → download → upload

配置

plugins.yml

product: idea plugins: - GitHub Copilot - Your AI Pair Programmer - .ignore
  • product:用于 searchSuggest API 的 product 参数(idea / pycharm / webstorm 等)
  • plugins:插件在 Marketplace 上的显示名(用于精确匹配 searchSuggest 的 value 字段)

环境变量(仅 upload.sh 需要)

变量必填说明
CNB_API_ENDPOINTCNB Open API 基础地址
CNB_TOKENCNB 个人访问令牌
CNB_REPO_SLUG目标仓库路径(owner/repo
TAG_NAMERelease 标签(默认 JetBrains
RELEASE_NAMERelease 名称(默认 JetBrains Plugins

使用

# 完整流程 ./run.sh # 或分步执行 ./fetch.sh # plugins.yml → fetch.json ./download.sh # fetch.json → downloads/*.zip + download.json ./upload.sh # download.json → CNB Release

API 参考

  • 搜索建议:GET /api/searchSuggest?isIDERequest=false&product={product}&term={name}
  • 版本列表:GET /api/plugins/{pluginId}/updates?channel=&size=1
  • 下载:GET /plugin/download?rel=true&updateId={updateId}

输出示例

fetch.json

[ { "name": "GitHub Copilot - Your AI Pair Programmer", "url": "/plugin/17718-github-copilot--your-ai-pair-programmer", "pluginId": 17718, "updateId": 1022367, "version": "1.8.0-243", "filename": "github-copilot-intellij-1.8.0-243.zip", "downloadUrl": "https://plugins.jetbrains.com/plugin/download?rel=true&updateId=1022367", "status": "pending" } ]

download.json(供 upload.sh 消费):

[ { "extension": "GitHub Copilot - Your AI Pair Programmer", "filename": "github-copilot-intellij-1.8.0-243.zip", "localPath": "downloads/github-copilot-intellij-1.8.0-243.zip", "version": "1.8.0-243", "updateId": 1022367, "status": "success" } ]

可覆盖路径

PLUGINS_YML=custom.yml ./fetch.sh FETCH_JSON=fetch.json DOWNLOAD_JSON=download.json DOWNLOAD_DIR=downloads ./download.sh

About

No description, topics, or website provided.