mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 06:55:36 +08:00
77 lines
2.2 KiB
YAML
77 lines
2.2 KiB
YAML
name: Release Drafter
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
pull_request_target:
|
|
branches:
|
|
- master
|
|
types:
|
|
- closed
|
|
|
|
jobs:
|
|
update-release-draft:
|
|
if: github.event_name == 'pull_request_target'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: release-drafter/release-drafter@v5
|
|
id: release-drafter
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Update Changelog
|
|
uses: docker://ghcr.io/nonebot/auto-changelog:master
|
|
with:
|
|
changelog_file: website/src/pages/changelog.md
|
|
latest_changes_position: '# 更新日志\n\n'
|
|
changelog_body: ${{ steps.release-drafter.outputs.body }}
|
|
|
|
release:
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Python Environment
|
|
uses: ./.github/actions/setup-python
|
|
|
|
- name: Setup Node Environment
|
|
uses: ./.github/actions/setup-node
|
|
|
|
- name: Build API Doc
|
|
uses: ./.github/actions/build-api-doc
|
|
|
|
- run: |
|
|
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
|
|
- uses: release-drafter/release-drafter@v5
|
|
with:
|
|
name: Release ${{ env.TAG_NAME }} 🌈
|
|
tag: ${{ env.TAG_NAME }}
|
|
publish: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and Publish Package
|
|
run: |
|
|
poetry build
|
|
poetry publish -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.PYPI_PASSWORD}}
|
|
gh release upload --clobber ${{ env.TAG_NAME }} dist/*.tar.gz dist/*.whl
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and Publish Doc Package
|
|
run: |
|
|
yarn build:plugin --out-dir ../packages/nonebot-plugin-docs/nonebot_plugin_docs/dist
|
|
export NONEBOT_VERSION=`poetry version -s`
|
|
cd packages/nonebot-plugin-docs/
|
|
poetry version $NONEBOT_VERSION
|
|
poetry build
|
|
poetry publish -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.PYPI_PASSWORD}}
|
|
gh release upload --clobber ${{ env.TAG_NAME }} dist/*.tar.gz dist/*.whl
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|