🐛 fix build and ci bug

This commit is contained in:
yanyongyu 2021-12-02 14:03:06 +08:00
parent 7d8a60b033
commit dcb6f69f21
7 changed files with 134 additions and 21 deletions

View File

@ -14,7 +14,17 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '16' node-version: "16"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Packages
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
@ -27,7 +37,7 @@ jobs:
- name: Build Docs - name: Build Docs
run: | run: |
yarn install yarn install
yarn build:plugin --out-dir ./packages/nonebot-plugin-docs/nonebot_plugin_docs/dist yarn build:plugin --out-dir ../packages/nonebot-plugin-docs/nonebot_plugin_docs/dist
- name: Publish Package - name: Publish Package
run: | run: |

View File

@ -25,6 +25,21 @@ jobs:
path: ~/.cache/pypoetry/virtualenvs path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Packages
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Set up dependencies - name: Set up dependencies
run: | run: |
poetry install -E all poetry install -E all
@ -36,7 +51,9 @@ jobs:
run: cp -r ./build/markdown/* ./website/docs/api/ run: cp -r ./build/markdown/* ./website/docs/api/
- name: Archive Files - name: Archive Files
run: yarn archive $(poetry version -s) run: |
yarn install
yarn archive $(poetry version -s)
- name: Push Tag and Release to PyPI - name: Push Tag and Release to PyPI
run: | run: |

View File

@ -17,6 +17,24 @@ jobs:
with: with:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: "x64"
- uses: Gr1N/setup-poetry@v4
- uses: actions/cache@v1
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
@ -26,11 +44,13 @@ jobs:
with: with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | run: cp -r ./build/markdown/* ./website/docs/api/
${{ runner.os }}-yarn-
- name: Install and build - name: Install and build
run: | run: |
poetry install -E all
poetry run sphinx-build -M markdown ./docs_build ./build
cp -r ./build/markdown/* ./website/docs/api/
yarn install yarn install
yarn build yarn build

View File

@ -9,9 +9,11 @@
"build": "yarn workspace nonebot build", "build": "yarn workspace nonebot build",
"build:plugin": "cross-env BASE_URL='/docs/' yarn workspace nonebot build", "build:plugin": "cross-env BASE_URL='/docs/' yarn workspace nonebot build",
"start": "yarn workspace nonebot start", "start": "yarn workspace nonebot start",
"clear": "yarn workspace nonebot clear",
"prettier": "prettier --config ./.prettierrc --write \"./website/**/*.md\"" "prettier": "prettier --config ./.prettierrc --write \"./website/**/*.md\""
}, },
"devDependencies": { "devDependencies": {
"cross-env": "^7.0.3",
"prettier": "^2.5.0" "prettier": "^2.5.0"
}, },
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
# Mirai-API-HTTP 协议使用指南 # Mirai-API-HTTP 协议使用指南
::: warning :::warning
Mirai-API-HTTP 的适配现在仍然处于早期阶段, 可能没有进行过充分的测试 Mirai-API-HTTP 的适配现在仍然处于早期阶段, 可能没有进行过充分的测试
@ -8,7 +8,7 @@ Mirai-API-HTTP 的适配现在仍然处于早期阶段, 可能没有进行过充
::: :::
::: tip :::tip
为了你的使用之旅更加顺畅, 我们建议您在配置之前具有以下的前置知识 为了你的使用之旅更加顺畅, 我们建议您在配置之前具有以下的前置知识
@ -18,7 +18,7 @@ Mirai-API-HTTP 的适配现在仍然处于早期阶段, 可能没有进行过充
::: :::
::: danger :::danger
Mirai-API-HTTP 的适配器以 [AGPLv3 许可](https://opensource.org/licenses/AGPL-3.0) 单独开源 Mirai-API-HTTP 的适配器以 [AGPLv3 许可](https://opensource.org/licenses/AGPL-3.0) 单独开源
@ -59,7 +59,7 @@ pip install nonebot-adapter-mirai
- 在 Mirai Console Loader 目录下执行该指令 - 在 Mirai Console Loader 目录下执行该指令
- ```shell ```bash
./mcl --update-package net.mamoe:mirai-api-http --channel stable --type plugin ./mcl --update-package net.mamoe:mirai-api-http --channel stable --type plugin
``` ```
@ -67,7 +67,7 @@ pip install nonebot-adapter-mirai
4. 修改配置文件 4. 修改配置文件
::: tip :::tip
在此之前, 你可能需要了解我们为 MAH 设计的两种通信方式 在此之前, 你可能需要了解我们为 MAH 设计的两种通信方式
@ -97,7 +97,7 @@ pip install nonebot-adapter-mirai
- `nonebot.drivers.fastapi`: 同时支持正向和反向 - `nonebot.drivers.fastapi`: 同时支持正向和反向
- `nonebot.drivers.aiohttp`: 仅支持正向 - `nonebot.drivers.aiohttp`: 仅支持正向
::: warning :::warning
在默认情况下, NoneBot 和 MAH 会同时监听 8080 端口, 这会导致端口冲突的错误 在默认情况下, NoneBot 和 MAH 会同时监听 8080 端口, 这会导致端口冲突的错误
请确保二者配置不在同一端口下 请确保二者配置不在同一端口下
@ -149,7 +149,7 @@ pip install nonebot-adapter-mirai
- ```yaml - ```yaml
# 省略了部分无需修改的部分 # 省略了部分无需修改的部分
host: '0.0.0.0' # 监听地址 host: "0.0.0.0" # 监听地址
port: 8080 # 监听端口 port: 8080 # 监听端口
authKey: 1234567890 # 访问密钥, 最少八位 authKey: 1234567890 # 访问密钥, 最少八位
@ -157,7 +157,7 @@ pip install nonebot-adapter-mirai
report: report:
enable: true # 必须为true enable: true # 必须为true
groupMessage: groupMessage:
report: true # 群消息上报 report: true # 群消息上报
friendMessage: friendMessage:
report: true # 好友消息上报 report: true # 好友消息上报
tempMessage: tempMessage:
@ -165,7 +165,7 @@ pip install nonebot-adapter-mirai
eventMessage: eventMessage:
report: true # 事件上报 report: true # 事件上报
destinations: destinations:
- 'http://127.0.0.1:2333/mirai/http' #上报地址, 请按照实际情况修改 - "http://127.0.0.1:2333/mirai/http" #上报地址, 请按照实际情况修改
# 上报时的额外Header # 上报时的额外Header
extraHeaders: {} extraHeaders: {}
``` ```

View File

@ -9,12 +9,19 @@ const config = {
title: "NoneBot", title: "NoneBot",
tagline: "跨平台 Python 异步机器人框架", tagline: "跨平台 Python 异步机器人框架",
url: "https://v2.nonebot.dev", url: "https://v2.nonebot.dev",
baseUrl: "/", baseUrl: process.env.BASE_URL || "/",
onBrokenLinks: "throw", onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn", onBrokenMarkdownLinks: "warn",
favicon: "icons/favicon.ico", favicon: "icons/favicon.ico",
organizationName: "nonebot", // Usually your GitHub org/user name. organizationName: "nonebot", // Usually your GitHub org/user name.
projectName: "nonebot2", // Usually your repo name. projectName: "nonebot2", // Usually your repo name.
i18n: {
defaultLocale: "zh-Hans",
locales: ["zh-Hans"],
localeConfigs: {
"zh-Hans": { label: "简体中文" },
},
},
presets: [ presets: [
[ [
@ -33,7 +40,7 @@ const config = {
], ],
themeConfig: themeConfig:
/** @type {import('docusaurus-theme-nonepress/types').ThemeConfig} */ /** @type {import('docusaurus-preset-nonepress').ThemeConfig} */
({ ({
colorMode: { colorMode: {
defaultMode: "light", defaultMode: "light",

View File

@ -2857,7 +2857,14 @@ cosmiconfig@^7.0.0, cosmiconfig@^7.0.1:
path-type "^4.0.0" path-type "^4.0.0"
yaml "^1.10.0" yaml "^1.10.0"
cross-spawn@^7.0.3: cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.npm.taobao.org/cross-env/download/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha1-hlJkspZ33AFbqEGJGJZd0jL8VM8=
dependencies:
cross-spawn "^7.0.1"
cross-spawn@^7.0.1, cross-spawn@^7.0.3:
version "7.0.3" version "7.0.3"
resolved "https://registry.nlark.com/cross-spawn/download/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" resolved "https://registry.nlark.com/cross-spawn/download/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha1-9zqFudXUHQRVUcF34ogtSshXKKY= integrity sha1-9zqFudXUHQRVUcF34ogtSshXKKY=
@ -3230,7 +3237,7 @@ dns-txt@^2.0.2:
dependencies: dependencies:
buffer-indexof "^1.0.0" buffer-indexof "^1.0.0"
docusaurus-preset-nonepress@0.0.0-108, docusaurus-preset-nonepress@canary: docusaurus-preset-nonepress@0.0.0-108:
version "0.0.0-108" version "0.0.0-108"
resolved "https://registry.npmmirror.com/docusaurus-preset-nonepress/download/docusaurus-preset-nonepress-0.0.0-108.tgz#37a4068c71fe335d2486d9effcadcb18503b50cb" resolved "https://registry.npmmirror.com/docusaurus-preset-nonepress/download/docusaurus-preset-nonepress-0.0.0-108.tgz#37a4068c71fe335d2486d9effcadcb18503b50cb"
integrity sha512-GuH22RrrI5FWiUPIKEWWisWJ/laymWMY+aFbfXY5fNLzarLFkAmshUpGHuuAMAnL/U1W812RYyJNoNHnUA/XgQ== integrity sha512-GuH22RrrI5FWiUPIKEWWisWJ/laymWMY+aFbfXY5fNLzarLFkAmshUpGHuuAMAnL/U1W812RYyJNoNHnUA/XgQ==
@ -3240,6 +3247,16 @@ docusaurus-preset-nonepress@0.0.0-108, docusaurus-preset-nonepress@canary:
"@docusaurus/plugin-content-pages" "2.0.0-beta.9" "@docusaurus/plugin-content-pages" "2.0.0-beta.9"
docusaurus-theme-nonepress "0.0.0-108" docusaurus-theme-nonepress "0.0.0-108"
docusaurus-preset-nonepress@canary:
version "0.0.0-109"
resolved "https://registry.npmmirror.com/docusaurus-preset-nonepress/download/docusaurus-preset-nonepress-0.0.0-109.tgz#bb3d373beb908ae981a1e0f41e3d2d3619672c0c"
integrity sha512-bZRyInMVPdJ9jn/lo/24yT67WwuO0yPVOItRe3f7w2ziDUMIQ1/UM2RAc8My+RyRbByyFu6kWc9SBIeJlmupVQ==
dependencies:
"@docusaurus/core" "2.0.0-beta.9"
"@docusaurus/plugin-content-docs" "2.0.0-beta.9"
"@docusaurus/plugin-content-pages" "2.0.0-beta.9"
docusaurus-theme-nonepress "0.0.0-109"
docusaurus-theme-nonepress@0.0.0-108: docusaurus-theme-nonepress@0.0.0-108:
version "0.0.0-108" version "0.0.0-108"
resolved "https://registry.npmmirror.com/docusaurus-theme-nonepress/download/docusaurus-theme-nonepress-0.0.0-108.tgz#d1e381a446d1179841ae4fe5f51cd6314df9b0a1" resolved "https://registry.npmmirror.com/docusaurus-theme-nonepress/download/docusaurus-theme-nonepress-0.0.0-108.tgz#d1e381a446d1179841ae4fe5f51cd6314df9b0a1"
@ -3280,6 +3297,46 @@ docusaurus-theme-nonepress@0.0.0-108:
react-router-dom "^5.2.0" react-router-dom "^5.2.0"
tailwindcss ">=3.0.0 || >=3.0.0-alpha.1" tailwindcss ">=3.0.0 || >=3.0.0-alpha.1"
docusaurus-theme-nonepress@0.0.0-109:
version "0.0.0-109"
resolved "https://registry.npmmirror.com/docusaurus-theme-nonepress/download/docusaurus-theme-nonepress-0.0.0-109.tgz#955b8ca07b9c4d971ec9eb7d86d98f5b5640c4a2"
integrity sha512-qkck6fAYQPmajFeaWKzh61wIrOuxVVJDH+NhqyWHuSkbCqBxHo5qjHV3LZyZh+480PtAmHornkXVDluSJSRM7w==
dependencies:
"@docsearch/react" "^3.0.0-alpha.39"
"@docusaurus/core" "2.0.0-beta.9"
"@docusaurus/plugin-content-docs" "2.0.0-beta.9"
"@docusaurus/plugin-content-pages" "2.0.0-beta.9"
"@docusaurus/theme-common" "2.0.0-beta.9"
"@docusaurus/utils" "2.0.0-beta.9"
"@docusaurus/utils-common" "2.0.0-beta.9"
"@docusaurus/utils-validation" "2.0.0-beta.9"
"@fortawesome/fontawesome-svg-core" "^1.2.36"
"@fortawesome/free-brands-svg-icons" "^5.15.4"
"@fortawesome/free-regular-svg-icons" "^5.15.4"
"@fortawesome/free-solid-svg-icons" "^5.15.4"
"@fortawesome/react-fontawesome" "^0.1.16"
"@mdx-js/mdx" "^1.6.21"
"@mdx-js/react" "^1.6.21"
"@seznam/compose-react-refs" "^1.0.6"
"@tailwindcss/typography" "^0.5.0-alpha.3"
algoliasearch "^4.11.0"
algoliasearch-helper "^3.5.5"
autoprefixer "^10.3.1"
chalk "^4.1.2"
clsx "^1.1.1"
copy-text-to-clipboard "^3.0.1"
eta "^1.12.3"
globby "^11.0.2"
lodash "^4.17.20"
parse-numeric-range "^1.2.0"
postcss "^8.3.7"
postcss-import "^14.0.2"
prism-react-renderer "^1.2.1"
prismjs "^1.23.0"
react-cool-onclickoutside "^1.6.2"
react-router-dom "^5.2.0"
tailwindcss ">=3.0.0 || >=3.0.0-alpha.1"
dom-converter@^0.2.0: dom-converter@^0.2.0:
version "0.2.0" version "0.2.0"
resolved "https://registry.npm.taobao.org/dom-converter/download/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" resolved "https://registry.npm.taobao.org/dom-converter/download/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768"
@ -3392,9 +3449,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
electron-to-chromium@^1.3.896: electron-to-chromium@^1.3.896:
version "1.4.7" version "1.4.8"
resolved "https://registry.npmmirror.com/electron-to-chromium/download/electron-to-chromium-1.4.7.tgz#58e0b4ec9096ee1422e4d9e83ceeb05b0cf076eb" resolved "https://registry.npmmirror.com/electron-to-chromium/download/electron-to-chromium-1.4.8.tgz#e1b7752ac1a75e39b5dd90cc7e29ea08b351c484"
integrity sha512-UPy2MsQw1OdcbxR7fvwWZH/rXcv+V26+uvQVHx0fGa1kqRfydtfOw+NMGAvZJ63hyaH4aEBxbhSEtqbpliSNWA== integrity sha512-Cu5+dbg55+1E3ohlsa8HT0s4b8D0gBewXEGG8s5wBl8ynWv60VuvYW25GpsOeTVXpulhyU/U8JYZH+yxASSJBQ==
emoji-regex@^8.0.0: emoji-regex@^8.0.0:
version "8.0.0" version "8.0.0"