mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-26 12:55:06 +08:00
🐛 docs: 添加发布插件表单
This commit is contained in:
parent
76be748160
commit
aa4d930cc4
@ -1,67 +0,0 @@
|
|||||||
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
|
|
||||||
#
|
|
||||||
name: Deploy VitePress site to Pages
|
|
||||||
|
|
||||||
on:
|
|
||||||
# 在针对 `main` 分支的推送上运行。如果你
|
|
||||||
# 使用 `master` 分支作为默认分支,请将其更改为 `master`
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
# 允许你从 Actions 选项卡手动运行此工作流程
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
|
|
||||||
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# 构建工作
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
|
|
||||||
# - uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消注释
|
|
||||||
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
|
|
||||||
- name: Setup API markdown
|
|
||||||
run: |-
|
|
||||||
python -m pip install litedoc
|
|
||||||
litedoc liteyuki -o docs/zh/dev/api -l zh-Hans -cd class -fd func -md func -vd var -cs -bu https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/
|
|
||||||
litedoc liteyuki -o docs/en/dev/api -l en -cd class -fd func -md func -vd var -cs -bu https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/
|
|
||||||
|
|
||||||
- name: 安装 pnpm
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
with:
|
|
||||||
run_install: true
|
|
||||||
version: 8
|
|
||||||
|
|
||||||
- name: 设置 Node.js
|
|
||||||
run: |-
|
|
||||||
cd docs
|
|
||||||
pnpm install
|
|
||||||
|
|
||||||
- name: 构建文档
|
|
||||||
env:
|
|
||||||
NODE_OPTIONS: --max_old_space_size=8192
|
|
||||||
run: |-
|
|
||||||
cd docs
|
|
||||||
pnpm run docs:build
|
|
||||||
> .vitepress/dist/.nojekyll
|
|
||||||
|
|
||||||
- name: 部署文档
|
|
||||||
uses: JamesIves/github-pages-deploy-action@v4
|
|
||||||
with:
|
|
||||||
# 这是文档部署到的分支名称
|
|
||||||
branch: docs
|
|
||||||
folder: docs/.vitepress/dist
|
|
@ -1,7 +1,7 @@
|
|||||||
name: 发布资源
|
name: 发布资源
|
||||||
title: "Plugin: {name}"
|
title: "Resource: {name}"
|
||||||
description: 发布资源到轻雪机器人官方商店
|
description: 发布资源到轻雪机器人官方商店
|
||||||
labels: ["Resource"]
|
labels: [ "Resource" ]
|
||||||
body:
|
body:
|
||||||
- type: input
|
- type: input
|
||||||
id: name
|
id: name
|
||||||
|
43
.github/ISSUE_TEMPLATE/zh/resource_publish.yml
vendored
43
.github/ISSUE_TEMPLATE/zh/resource_publish.yml
vendored
@ -1,43 +0,0 @@
|
|||||||
name: 发布插件
|
|
||||||
title: "Plugin: {name}"
|
|
||||||
description: 发布插件到 NoneBot 官方商店
|
|
||||||
labels: ["Plugin"]
|
|
||||||
body:
|
|
||||||
- type: input
|
|
||||||
id: pypi
|
|
||||||
attributes:
|
|
||||||
label: PyPI 项目名
|
|
||||||
description: PyPI 项目名
|
|
||||||
placeholder: e.g. nonebot-plugin-xxx
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: module
|
|
||||||
attributes:
|
|
||||||
label: 插件 import 包名
|
|
||||||
description: 插件 import 包名
|
|
||||||
placeholder: e.g. nonebot_plugin_xxx
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: tags
|
|
||||||
attributes:
|
|
||||||
label: 标签
|
|
||||||
description: 标签
|
|
||||||
placeholder: 'e.g. [{"label": "标签名", "color": "#ea5252"}]'
|
|
||||||
value: "[]"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: config
|
|
||||||
attributes:
|
|
||||||
label: 插件配置项
|
|
||||||
description: 插件配置项
|
|
||||||
render: dotenv
|
|
||||||
placeholder: |
|
|
||||||
# e.g.
|
|
||||||
# KEY=VALUE
|
|
||||||
# KEY2=VALUE2
|
|
@ -3,11 +3,11 @@
|
|||||||
"""
|
"""
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from github.Issue import Issue
|
||||||
|
|
||||||
from liteyuki_flow.typ import Nil, err, nil # type: ignore
|
from liteyuki_flow.typ import Nil, err, nil # type: ignore
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# # xxx
|
# # xxx
|
||||||
class Header:
|
class Header:
|
||||||
def __init__(self, level: int, content: str):
|
def __init__(self, level: int, content: str):
|
||||||
@ -137,3 +137,10 @@ class MarkdownParser:
|
|||||||
self._parsed = True
|
self._parsed = True
|
||||||
|
|
||||||
return self._content_list, nil
|
return self._content_list, nil
|
||||||
|
|
||||||
|
|
||||||
|
# 解析资源发布issue体
|
||||||
|
def parse_resource_publish_info(issue: Issue) -> dict[str, str]:
|
||||||
|
parser = MarkdownParser(issue.body)
|
||||||
|
parser.parse_front_matters()
|
||||||
|
return parser.front_matters
|
@ -121,14 +121,6 @@ def pre_check(github: Github, issue: Issue, repo: Repository) -> err:
|
|||||||
def add_resource(github: Github, issue: Issue, repo: Repository) -> err:
|
def add_resource(github: Github, issue: Issue, repo: Repository) -> err:
|
||||||
# 检测关闭时是否有管理员发布的通过评论
|
# 检测关闭时是否有管理员发布的通过评论
|
||||||
try:
|
try:
|
||||||
# closed_by = issue.closed_by
|
|
||||||
# if closed_by is None:
|
|
||||||
# print(issue.closed_by)
|
|
||||||
# push_publish_result(issue, "❌ 无法获取关闭者信息。")
|
|
||||||
# return ValueError("无法获取关闭者信息。")
|
|
||||||
# if not any([True for u in repo.get_collaborators() if u.login == closed_by.login]):
|
|
||||||
# push_publish_result(issue, "❌ 你不是仓库管理员,无法发布资源包。")
|
|
||||||
# return ValueError("你不是仓库管理员,无法发布资源包。")
|
|
||||||
if "pre-checked" not in [l.name for l in issue.labels]:
|
if "pre-checked" not in [l.name for l in issue.labels]:
|
||||||
issue.edit(state="open")
|
issue.edit(state="open")
|
||||||
push_publish_result(issue, "❌ 请先通过预检查。")
|
push_publish_result(issue, "❌ 请先通过预检查。")
|
||||||
@ -159,11 +151,11 @@ def add_resource(github: Github, issue: Issue, repo: Repository) -> err:
|
|||||||
# 编辑仓库内的json文件
|
# 编辑仓库内的json文件
|
||||||
resources = json.load(open(RESOURCE_JSON))
|
resources = json.load(open(RESOURCE_JSON))
|
||||||
resources.append({
|
resources.append({
|
||||||
"name" : name,
|
"name": name,
|
||||||
"description": desc,
|
"description": desc,
|
||||||
"link" : link,
|
"link": link,
|
||||||
"homepage" : homepage,
|
"homepage": homepage,
|
||||||
"author" : author
|
"author": author
|
||||||
})
|
})
|
||||||
ref = repo.get_git_ref("heads/main")
|
ref = repo.get_git_ref("heads/main")
|
||||||
tree = repo.create_git_tree(
|
tree = repo.create_git_tree(
|
||||||
|
Loading…
Reference in New Issue
Block a user