Plugin: nonebot-plugin-nearcade-reporter #1668
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| concurrency: | |
| group: pull-request-changelog | |
| cancel-in-progress: true | |
| steps: | |
| - name: Generate token | |
| id: generate-token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: ${{ secrets.APP_ID }} | |
| private_key: ${{ secrets.APP_KEY }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| - name: Setup Node Environment | |
| uses: ./.github/actions/setup-node | |
| - uses: release-drafter/release-drafter@v6.0.0 | |
| id: release-drafter | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| - name: Update Changelog | |
| uses: docker://ghcr.io/nonebot/auto-changelog:master | |
| with: | |
| changelog_file: website/src/changelog/changelog.md | |
| latest_changes_position: '# 更新日志\n\n' | |
| latest_changes_title: "## 最近更新" | |
| replace_regex: '(?<=## 最近更新\n)[\s\S]*?(?=\n## )' | |
| changelog_body: ${{ steps.release-drafter.outputs.body }} | |
| commit_and_push: false | |
| - name: Commit and Push | |
| run: | | |
| yarn prettier | |
| git config user.name noneflow[bot] | |
| git config user.email 129742071+noneflow[bot]@users.noreply.github.com | |
| git add . | |
| git diff-index --quiet HEAD || git commit -m ":memo: Update changelog" | |
| git push | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Generate token | |
| id: generate-token | |
| uses: tibdex/github-app-token@v2 | |
| with: | |
| app_id: ${{ secrets.APP_ID }} | |
| private_key: ${{ secrets.APP_KEY }} | |
| - uses: actions/checkout@v6 | |
| - 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 | |
| - name: Get Version | |
| id: version | |
| run: | | |
| echo "VERSION=$(uv version --short)" >> $GITHUB_OUTPUT | |
| echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Check Version | |
| if: steps.version.outputs.VERSION != steps.version.outputs.TAG_VERSION | |
| run: exit 1 | |
| - uses: release-drafter/release-drafter@v6.0.0 | |
| with: | |
| name: Release ${{ steps.version.outputs.TAG_NAME }} 🌈 | |
| tag: ${{ steps.version.outputs.TAG_NAME }} | |
| publish: true | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| - name: Build Package | |
| run: | | |
| uv build | |
| uv publish | |
| - name: Publish package to GitHub | |
| run: | | |
| gh release upload --clobber ${{ steps.version.outputs.TAG_NAME }} dist/*.tar.gz dist/*.whl | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
| - name: Build and Publish Doc Package | |
| run: | | |
| yarn build:plugin --out-dir ../packages/nonebot-plugin-docs/nonebot_plugin_docs/dist | |
| cd packages/nonebot-plugin-docs/ | |
| uv version ${{ steps.version.outputs.VERSION }} | |
| uv build | |
| uv publish | |
| - name: Publish Doc Package to GitHub | |
| run: | | |
| cd packages/nonebot-plugin-docs/ | |
| gh release upload --clobber ${{ steps.version.outputs.TAG_NAME }} dist/*.tar.gz dist/*.whl | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |