nonebot2/.github/workflows/publish-bot.yml

70 lines
2.0 KiB
YAML
Raw Normal View History

2021-12-02 03:17:10 +08:00
name: NoneBot2 Publish Bot
2020-11-20 00:30:46 +08:00
on:
issues:
types: [opened, reopened, edited]
pull_request_target:
2020-11-20 00:30:46 +08:00
types: [closed]
issue_comment:
types: [created]
2020-11-20 00:30:46 +08:00
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
cancel-in-progress: true
2020-11-20 00:30:46 +08:00
jobs:
plugin_test:
runs-on: ubuntu-latest
name: nonebot2 plugin test
if: github.event_name != 'issue_comment' || !github.event.issue.pull_request
permissions:
issues: read
outputs:
result: ${{ steps.plugin-test.outputs.RESULT }}
output: ${{ steps.plugin-test.outputs.OUTPUT }}
steps:
- name: Install Poetry
if: ${{ !startsWith(github.event_name, 'pull_request') }}
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Test Plugin
id: plugin-test
run: |
curl -sSL https://github.com/nonebot/nonebot2-publish-bot/releases/latest/download/plugin_test.py | python -
publish_bot:
2020-11-20 00:30:46 +08:00
runs-on: ubuntu-latest
name: nonebot2 publish bot
needs: plugin_test
2020-11-20 00:30:46 +08:00
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_KEY }}
- name: Checkout Code
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
- name: NoneBot2 Publish Bot
uses: docker://ghcr.io/nonebot/nonebot2-publish-bot:latest
2020-11-20 00:30:46 +08:00
with:
token: ${{ steps.generate-token.outputs.token }}
config: >
{
"base": "master",
"plugin_path": "website/static/plugins.json",
"bot_path": "website/static/bots.json",
"adapter_path": "website/static/adapters.json"
}
env:
PLUGIN_TEST_RESULT: ${{ needs.plugin_test.outputs.result }}
PLUGIN_TEST_OUTPUT: ${{ needs.plugin_test.outputs.output }}