mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 08:12:14 +08:00
commit
42157f3dd1
11
.github/workflows/site_deploy.yml
vendored
11
.github/workflows/site_deploy.yml
vendored
@ -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
|
||||
|
@ -71,6 +71,11 @@ pip install . # 不推荐
|
||||
|
||||
插件可以通过 `nb-cli` 进行安装,也可以自行安装并加载插件。
|
||||
|
||||
:::warning 注意
|
||||
如果你想直接从nb-cli安装插件,请确保你的当前目录中含有能正常工作的bot.py!
|
||||
安装完成后请重启当前bot.py(假如你在运行它的话)。
|
||||
:::
|
||||
|
||||
```bash
|
||||
# 列出所有的插件
|
||||
nb plugin list
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user