🔀 Merge pull request #231

Fix: deploy ci
This commit is contained in:
Ju4tCode 2021-02-23 10:12:18 +08:00 committed by GitHub
commit 42157f3dd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 6 deletions

View File

@ -40,17 +40,22 @@ jobs:
- name: Get Deploy Name
if: github.event_name == 'push'
run: echo "DEPLOY_NAME=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV
run: |
echo "DEPLOY_NAME=${{ env.BRANCH_NAME }}" >> $GITHUB_ENV
echo "PRODUCTION=${{ env.BRANCH_NAME == 'master' }}" >> $GITHUB_ENV
- name: Get Deploy Name
if: github.event_name != 'push'
run: echo "DEPLOY_NAME=deploy-preview-${{ github.event.number }}" >> $GITHUB_ENV
run: |
echo "DEPLOY_NAME=deploy-preview-${{ github.event.number }}" >> $GITHUB_ENV
echo "PRODUCTION=false" >> $GITHUB_ENV
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1
with:
publish-dir: './docs/.vuepress/dist'
production-branch: master
production-deploy: ${{ env.PRODUCTION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy ${{ env.DEPLOY_NAME }}@${{ github.sha }}'
enable-commit-comment: false

View File

@ -71,6 +71,11 @@ pip install . # 不推荐
插件可以通过 `nb-cli` 进行安装,也可以自行安装并加载插件。
:::warning 注意
如果你想直接从nb-cli安装插件请确保你的当前目录中含有能正常工作的bot.py
安装完成后请重启当前bot.py(假如你在运行它的话)。
:::
```bash
# 列出所有的插件
nb plugin list

View File

@ -36,9 +36,14 @@ from nonebot.utils import escape_tag
from nonebot.config import Env, Config
from nonebot.log import logger, default_filter
_dist: pkg_resources.Distribution = pkg_resources.get_distribution("nonebot2")
__version__ = _dist.version
VERSION = _dist.parsed_version
try:
_dist: pkg_resources.Distribution = pkg_resources.get_distribution(
"nonebot2")
__version__ = _dist.version
VERSION = _dist.parsed_version
except pkg_resources.DistributionNotFound:
__version__ = None
VERSION = None
_driver: Optional[Driver] = None