From 6aa090ad3bad4450872183e9e7c594d7fac19723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=91=E8=BD=BB=E7=8B=82?= <1677568218@qq.com> Date: Wed, 16 Aug 2023 18:20:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E5=A7=8B=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/automatic_review.yaml | 35 -- .../marketplace_submission.yaml | 20 + .github/actions_scripts/parse.py | 81 +++ .../workflows/templates/validation-failed.md | 2 - .github/workflows/validate.yaml | 141 +++++ adapters.json | 15 + bots.json | 20 + .github/workflows/ic.yaml => ic.yaml | 0 plugins.json | 567 +----------------- pyproject.toml | 3 +- requirements.txt | 1 + .../validation.yaml => validation.yaml | 0 12 files changed, 304 insertions(+), 581 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/automatic_review.yaml create mode 100644 .github/ISSUE_TEMPLATE/marketplace_submission.yaml create mode 100644 .github/actions_scripts/parse.py create mode 100644 .github/workflows/validate.yaml create mode 100644 adapters.json create mode 100644 bots.json rename .github/workflows/ic.yaml => ic.yaml (100%) create mode 100644 requirements.txt rename .github/workflows/validation.yaml => validation.yaml (100%) diff --git a/.github/ISSUE_TEMPLATE/automatic_review.yaml b/.github/ISSUE_TEMPLATE/automatic_review.yaml deleted file mode 100644 index 7ac0646..0000000 --- a/.github/ISSUE_TEMPLATE/automatic_review.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Submit to plugin marketplace -description: Submit your plugin to be automatically validated and published on the marketplace. -title: '[Plugin]: ' -assignees: [] -body: - - type: markdown - attributes: - value: | - Thank you for creating an plugin and submitting it to our marketplace! - - type: input - attributes: - label: AliceBot plugin repository name - description: Provide the plugin repository pyproject toml URL for your plugin. - placeholder: https://raw.githubusercontent.com/AliceBotProject/alicebot/master/pyproject.toml - validations: - required: true - - type: markdown - attributes: - value: | - :warning: We automatically validate the plugin meta data. - - type: checkboxes - attributes: - label: Terms of services - options: - - label: I accept the [term of services](https://github.com/AliceBotProject/alicebot) - validations: - required: true - - type: markdown - attributes: - value: | - Once you have filled the form and submitted this issue, we will run automated validation on the plugin. - - :+1: If everything goes well, a new label `validation/succeeded` will be added and the alicebot docs will authorise the publication of the plugin to the marketplace. - - :confused: If there are issues, you will see details in comments on the issue and information about how to fix them and re-run validation. diff --git a/.github/ISSUE_TEMPLATE/marketplace_submission.yaml b/.github/ISSUE_TEMPLATE/marketplace_submission.yaml new file mode 100644 index 0000000..84f5258 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/marketplace_submission.yaml @@ -0,0 +1,20 @@ +name: Submit to marketplace +description: Submit your plugin to be automatically validated and published on the marketplace. +title: '[plugin/adapter/bot]: xxx' +body: + - type: markdown + attributes: + value: | + 请在标题中括号内填入类型,例如:[plugin],冒号后附带插件名称,例如:[plugin]: xxx + - type: input + attributes: + label: module_name + description: 导入时的模块名称,类型为bot时不填 + - type: input + attributes: + label: pypi_name + description: 导入时的模块名称,类型为bot时不填 + - type: markdown + attributes: + value: | + 感谢你的贡献,提交issue后将会进行自动审核。 diff --git a/.github/actions_scripts/parse.py b/.github/actions_scripts/parse.py new file mode 100644 index 0000000..5235155 --- /dev/null +++ b/.github/actions_scripts/parse.py @@ -0,0 +1,81 @@ +"""信息解析:1. 标题的type解析,如果不符合就报错 2. 提取name、module_name、pypi_name,如果不符合就报错 3. pypi_name在pip网站中检查,不存在则报错.""" +from __future__ import annotations + +import os +import re +import uuid +from pathlib import Path +from typing import Any + +import requests + +BASE_URL = "https://pypi.org/pypi" +CODE =404 + + + +def set_multiline_output(name:str, value:str)->None: + """Set Github Outputs.""" + with Path(os.environ["GITHUB_OUTPUT"]).open("a") as fh: + delimiter = uuid.uuid1() + print(f"{name}<<{delimiter}", file=fh) + print(value, file=fh) + print(delimiter, file=fh) + +def get_response(name: str) -> dict[str, Any] | None: + """Request response from PyPi API.""" + target_url = f"{BASE_URL}/{name}/json" + response = requests.get(target_url, timeout=5) + if response.status_code == CODE: + return None + return response.json() + +def check_pypi(name:str)->bool: + """Check module filename for conflict.""" + response = get_response(name) + + if response: + module_name = response.get("info", {}).get("package_url", "").split("/")[-2] + return name.lower() == module_name.lower() + + return False + +def parse_title(title:str)->dict[str, Any]: + """Prase Title.""" + pattern = r"\[(plugin|adapter|bot)\]:\s*(.+)" + match = re.match(pattern, title) + if match: + return {"type": match.group(1), "name": match.group(2)} + msg = "标题格式错误" + raise ValueError(msg) + +def main()->None: + """信息解析:1. 标题的type解析,如果不符合就报错 2. 提取name、module_name、pypi_name,如果不符合就报错 3. pypi_name在pip网站中检查,不存在则报错.""" + try: + title = os.environ["TITLE"] + except KeyError: + set_multiline_output("result", "error") + set_multiline_output("output", "Missing required input `TITLE`.") + return + try: + pypi_name = os.environ["PYPI_NAME"] + except KeyError: + set_multiline_output("result", "error") + set_multiline_output("output", "Missing required input `PYPI_NAME`.") + return + try: + parsed = parse_title(title) + except ValueError as e: + set_multiline_output("result", "error") + set_multiline_output("output", str(e)) + return + if (check_pypi(pypi_name) is False): + set_multiline_output("result", "error") + set_multiline_output("output", "输入的pypi_name存在问题") + return + set_multiline_output("result", "sucess") + set_multiline_output("output", "") + set_multiline_output("type", parsed.get("type","")) + set_multiline_output("name", parsed.get("name","")) + return +main() diff --git a/.github/workflows/templates/validation-failed.md b/.github/workflows/templates/validation-failed.md index 84fdc9e..1e0c016 100644 --- a/.github/workflows/templates/validation-failed.md +++ b/.github/workflows/templates/validation-failed.md @@ -5,5 +5,3 @@ Please fix the issues and check everything is ok locally. Then you can trigger the validation commenting `/validate` when you are ready. - -See [https://docs.docker.com/desktop/extensions-sdk/extensions/validate/](https://github.com/MarleneJiang/issue-ops/actions) for more information. diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..d0a29dd --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,141 @@ +name: Marketplace Actions + +on: + issues: + types: + - opened + - reopened + - edited + issue_comment: + types: + - created + - edited + +jobs: + react-to-new-issue: + name: Post a comment to new issues + if: github.event_name == 'issues' && github.event.action == 'opened' + runs-on: ubuntu-latest + outputs: + comment-id: ${{ steps.comment.outputs.comment-id }} + steps: + - name: Add comment + id: comment + uses: peter-evans/create-or-update-comment@v2 + with: + issue-number: ${{ github.event.issue.number }} + body: | + 感谢你的提交. + + 自动验证将在几分钟内开始. + is-revalidation: + if: github.event.issue.state == 'open' && github.event_name == 'issue_comment' + name: Verify if the comment is a revalidation request + runs-on: ubuntu-latest + steps: + - name: Run /validate command + env: + COMMENT_BODY: ${{ github.event.comment.body }} + run: | + command=$(echo "$COMMENT_BODY" | head -1) + if [[ $command != "/validate"* ]]; then + echo "No /validate command found in first line of the comment \"${command}\", skipping" >> $GITHUB_STEP_SUMMARY + exit 1 + fi + - name: Add reactions + uses: peter-evans/create-or-update-comment@v2 + with: + comment-id: ${{ github.event.comment.id }} + reactions: '+1' + parse-issue: + runs-on: ubuntu-latest + env: + REPO: ${{ github.repository }} + ISSUE_NUM: ${{ github.event.issue.number }} + ISSUE_TITLE: ${{ github.event.issue.title }} + outputs: + module_name: ${{ steps.set-output.outputs.module_name }} + pypi_name: ${{ steps.set-output.outputs.pypi_name }} + result: ${{ steps.run.outputs.result }} + output: ${{ steps.run.outputs.output }} + type: ${{ steps.run.outputs.type }} + name: ${{ steps.run.outputs.name }} + steps: + - name: Parse issue body + id: parse + uses: zentered/issue-forms-body-parser@v1.5.1 + + - name: Get Inputs + id: set-output + env: + JSON_DATA: ${{ steps.parse.outputs.data }} + run: | + module_name=$(echo $JSON_DATA | jq -r '.["module_name"].text' ) + echo "module_name=$module_name" >> $GITHUB_OUTPUT + pypi_name=$(echo $JSON_DATA | jq -r '.["pypi_name"].text' ) + echo "pypi_name=$pypi_name" >> $GITHUB_OUTPUT + + # 启动py脚本环境,并传入module_name,pypi_name,ISSUE_TITLE + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run Python script + id: run + env: + TITLE: ${{ env.ISSUE_TITLE }} + PYPI_NAME: ${{ steps.set-output.outputs.pypi_name }} + run: | + python .github/actions_scripts/parse.py + + validation-failed: + runs-on: ubuntu-latest + needs: parse-issue + if: needs.parse-issue.outputs.result == 'error' + steps: + - uses: actions/checkout@v3.3.0 + + - name: Render template + id: render + uses: chuhlomin/render-template@v1.6 + with: + template: .github/workflows/templates/validation-failed.md + vars: | + validation_output: ${{ needs.parse-issue.outputs.output }} + + - name: Add comment + uses: peter-evans/create-or-update-comment@v3.0.2 + with: + issue-number: ${{ github.event.issue.number }} + body: ${{ steps.render.outputs.result }} + + - name: Remove label validation/succeeded + if: contains(github.event.issue.labels.*.name, 'validation/succeeded') + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: ["validation/succeeded"] + }) + + - name: Add label validation/failed + if: contains(github.event.issue.labels.*.name, 'validation/failed') == false + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["validation/failed"] + }) + + - name: Mark job as failed + run: exit 1 \ No newline at end of file diff --git a/adapters.json b/adapters.json new file mode 100644 index 0000000..2d38dd7 --- /dev/null +++ b/adapters.json @@ -0,0 +1,15 @@ +{ + "adapters": [ + { + "module_name": "adapter_module", + "pypi_name": "adapter_pypi", + "name": "适配器插件", + "description": "这是一个适配器插件。", + "author": "作者名", + "license": "Apache", + "homepage": "http://github.com/adapter", + "tags": ["adapter"], + "is_official": true + } + ] +} diff --git a/bots.json b/bots.json new file mode 100644 index 0000000..49c2064 --- /dev/null +++ b/bots.json @@ -0,0 +1,20 @@ +{ + "bots": [ + { + "name": "机器人1", + "description": "这是一个机器人示例。", + "author": "作者名", + "license": "GPL", + "homepage": "http://github.com/bot1", + "tags": ["bot", "example"], + "is_official": true + }, + { + "name": "机器人2", + "description": "这是另一个机器人示例。", + "author": "作者名", + "tags": ["bot", "test"], + "is_official": false + } + ] +} diff --git a/.github/workflows/ic.yaml b/ic.yaml similarity index 100% rename from .github/workflows/ic.yaml rename to ic.yaml diff --git a/plugins.json b/plugins.json index 40ed728..ee5158c 100644 --- a/plugins.json +++ b/plugins.json @@ -1,543 +1,24 @@ -{ - "data": [ - { - "type": "plugin", - "name": "信息整合插件", - "description": "校园通知信息推送", - "tags": [ - "信息整合", - "通知" - ], - "author": "Marlene", - "pip": "infostream", - "version": "1.0.0", - "vertified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "adapter", - "name": "钉钉协议", - "description": "钉钉协议适配器", - "tags": [ - "信息整合", - "通知" - ], - "author": "AliceBot", - "pip": "adapter-ding", - "version": "1.2.0", - "vertified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Github Bot", - "description": "github更新推送示例", - "tags": [ - "github" - ], - "author": "Marlene", - "version": "1.0.0", - "vertified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "plugin", - "name": "天气预报插件", - "description": "获取实时天气预报信息", - "tags": [ - "天气", - "预报" - ], - "author": "John", - "pip": "weatherstream", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/JohnBotProject/johnbot.git" - }, - { - "type": "adapter", - "name": "Slack协议", - "description": "Slack协议适配器", - "tags": [ - "信息整合", - "通知" - ], - "author": "AliceBot", - "pip": "adapter-slack", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Twitter Bot", - "description": "Twitter更新推送示例", - "tags": [ - "twitter" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "翻译插件", - "description": "支持多种语言的翻译插件", - "tags": [ - "翻译", - "多语言" - ], - "author": "Lily", - "pip": "translationstream", - "version": "1.1.0", - "verified": true, - "url": "git+ssh://git@github.com/LilyBotProject/lilybot.git" - }, - { - "type": "adapter", - "name": "微信协议", - "description": "微信协议适配器", - "tags": [ - "信息整合", - "通知" - ], - "author": "John", - "pip": "adapter-wechat", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/JohnBotProject/johnbot.git" - }, - { - "type": "example", - "name": "Reddit Bot", - "description": "Reddit更新推送示例", - "tags": [ - "reddit" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "股票行情插件", - "description": "获取实时股票行情信息", - "tags": [ - "股票", - "行情" - ], - "author": "David", - "pip": "stockstream", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/DavidBotProject/davidbot.git" - }, - { - "type": "adapter", - "name": "微博协议", - "description": "微博协议适配器", - "tags": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-weibo", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Facebook Bot", - "description": "Facebook更新推送示例", - "tags": [ - "facebook" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "新闻推送插件", - "description": "获取最新的新闻推送信息", - "tags": [ - "新闻", - "推送" - ], - "author": "John", - "pip": "newsstream", - "version": "1.1.0", - "verified": true, - "url": "git+ssh://git@github.com/JohnBotProject/johnbot.git" - }, - { - "type": "adapter", - "name": "Telegram协议", - "description": "Telegram协议适配器", - "tags": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-telegram", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Medium Bot", - "description": "Medium更新推送示例", - "tags": [ - "medium" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "邮件发送插件", - "description": "支持发送邮件的插件", - "tag": [ - "邮件", - "发送" - ], - "author": "David", - "pip": "mailstream", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/DavidBotProject/davidbot.git" - }, - { - "type": "adapter", - "name": "Twitter DM协议", - "description": "Twitter DM协议适配器", - "tag": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-twitterdm", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Instagram Bot", - "description": "Instagram更新推送示例", - "tag": [ - "instagram" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "热门视频插件", - "description": "获取最新的热门视频信息", - "tag": [ - "视频", - "热门" - ], - "author": "John", - "pip": "videostream", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/JohnBotProject/johnbot.git" - }, - { - "type": "adapter", - "name": "Facebook Messenger协议", - "description": "Facebook Messenger协议适配器", - "tag": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-fbmessenger", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "TikTok Bot", - "description": "TikTok更新推送示例", - "tag": [ - "tiktok" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "词典插件", - "description": "支持多种语言的词典插件", - "tag": [ - "词典", - "多语言" - ], - "author": "David", - "pip": "dictstream", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/DavidBotProject/davidbot.git" - }, - { - "type": "adapter", - "name": "LINE协议", - "description": "LINE协议适配器", - "tag": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-line", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Pinterest Bot", - "description": "Pinterest更新推送示例", - "tag": [ - "pinterest" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "音乐推荐插件", - "description": "获取最新的音乐推荐信息", - "tag": [ - "音乐", - "推荐" - ], - "author": "John", - "pip": "musicstream", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/JohnBotProject/johnbot.git" - }, - { - "type": "adapter", - "name": "Skype协议", - "description": "Skype协议适配器", - "tag": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-skype", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Snapchat Bot", - "description": "Snapchat更新推送示例", - "tag": [ - "snapchat" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "天气插件", - "description": "获取实时天气信息", - "tag": [ - "天气", - "实时" - ], - "author": "David", - "pip": "weatherstream", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/DavidBotProject/davidbot.git" - }, - { - "type": "adapter", - "name": "Viber协议", - "description": "Viber协议适配器", - "tag": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-viber", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Reddit Bot", - "description": "Reddit更新推送示例", - "tag": [ - "reddit" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "股市预测插件", - "description": "预测股市走势", - "tag": [ - "股市", - "预测" - ], - "author": "John", - "pip": "stockpredict", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/JohnBotProject/johnbot.git" - }, - { - "type": "adapter", - "name": "Slack协议", - "description": "Slack协议适配器", - "tag": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-slack", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Discord Bot", - "description": "Discord更新推送示例", - "tag": [ - "discord" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "🤺翻译插件", - "description": "支持多种语言的翻译插件", - "tag": [ - "翻译", - "多语言" - ], - "author": "David", - "pip": "translationstream", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/DavidBotProject/davidbot.git" - }, - { - "type": "adapter", - "name": "WeChat协议", - "description": "WeChat协议适配器", - "tag": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-wechat", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "Tumblr Bot", - "description": "Tumblr更新推送示例", - "tag": [ - "tumblr" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "type": "plugin", - "name": "测试插件", - "description": "仅供测试", - "tag": [ - "test", - "实时" - ], - "author": "test1", - "pip": "test", - "version": "1.2.0", - "verified": true, - "url": "git+ssh://git@github.com/JohnBotProject/johnbot.git" - }, - { - "type": "adapter", - "name": "Telegram协议", - "description": "Telegram协议适配器", - "tag": [ - "信息整合", - "社交" - ], - "author": "AliceBot", - "pip": "adapter-telegram", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/AliceBotProject/alicebot.git" - }, - { - "type": "example", - "name": "WhatsApp Bot", - "description": "WhatsApp更新推送示例", - "tag": [ - "whatsapp" - ], - "author": "Marlene", - "version": "1.0.0", - "verified": true, - "url": "git+ssh://git@github.com/MarleneBotProject/marlenebot.git" - }, - { - "name": "alicebot", - "description": "A simply asynchronous python chatbot framework.", - "version": "0.7.1", - "tags": [ - "bot", - "chatbot", - "qq", - "qqbot", - "cqhttp", - "coolq" - ], - "url": "https://github.com/AliceBotProject/alicebot", - "author": "st1020", - "pip": "alicebot", - "vertified": false, - "type": "plugin", - "update_time": "2023-07-29 08:39:27" - } - ] -} \ No newline at end of file +{ + "plugins": [ + { + "module_name": "example_module", + "pypi_name": "example_pypi", + "name": "Example Plugin", + "description": "这是一个示例插件。", + "author": "作者名", + "license": "MIT", + "homepage": "http://github.com/example", + "tags": ["tag1", "tag2"], + "is_official": true + }, + { + "module_name": "another_module", + "pypi_name": "another_pypi", + "name": "另一个插件", + "description": "这是另一个示例插件。", + "author": "另一作者", + "tags": ["tag3", "tag4"], + "is_official": false + } + ] +} diff --git a/pyproject.toml b/pyproject.toml index 433f9bb..6308cc1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [project] -name = "alicebot-plugin" +name = "alicebot-marketplace" version = "0.1.0" requires-python = ">=3.8" dependencies = [ "importlib>=1.0.4", "alicebot[all]>=0.7.1", + "requests>=2.31.0", ] [tool.pdm.dev-dependencies] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3cb65d1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requests==2.20.0 \ No newline at end of file diff --git a/.github/workflows/validation.yaml b/validation.yaml similarity index 100% rename from .github/workflows/validation.yaml rename to validation.yaml