2021-12-02 03:17:10 +08:00
|
|
|
name: Release
|
2020-09-30 19:12:44 +08:00
|
|
|
|
|
|
|
on:
|
2021-12-02 03:17:10 +08:00
|
|
|
workflow_dispatch:
|
2020-09-30 19:12:44 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-04-04 09:48:31 +08:00
|
|
|
- name: Generate token
|
|
|
|
id: generate-token
|
2023-09-11 12:52:59 +08:00
|
|
|
uses: tibdex/github-app-token@v2
|
2023-04-04 09:48:31 +08:00
|
|
|
with:
|
|
|
|
app_id: ${{ secrets.APP_ID }}
|
|
|
|
private_key: ${{ secrets.APP_KEY }}
|
|
|
|
|
2023-09-05 12:00:44 +08:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-30 19:12:44 +08:00
|
|
|
with:
|
2023-04-04 09:48:31 +08:00
|
|
|
token: ${{ steps.generate-token.outputs.token }}
|
2020-09-30 19:12:44 +08:00
|
|
|
|
2022-01-13 16:41:01 +08:00
|
|
|
- name: Setup Python Environment
|
|
|
|
uses: ./.github/actions/setup-python
|
2021-12-02 14:03:06 +08:00
|
|
|
|
2022-01-13 16:41:01 +08:00
|
|
|
- name: Setup Node Environment
|
|
|
|
uses: ./.github/actions/setup-node
|
2020-09-30 19:12:44 +08:00
|
|
|
|
2022-02-14 21:01:39 +08:00
|
|
|
- name: Build API Doc
|
|
|
|
uses: ./.github/actions/build-api-doc
|
2020-09-30 19:12:44 +08:00
|
|
|
|
2022-02-15 23:39:04 +08:00
|
|
|
- run: echo "TAG_NAME=v$(poetry version -s)" >> $GITHUB_ENV
|
|
|
|
|
2022-02-14 21:54:38 +08:00
|
|
|
- name: Archive Changelog
|
2022-02-16 11:10:54 +08:00
|
|
|
uses: docker://ghcr.io/nonebot/auto-changelog:master
|
2022-02-15 23:39:04 +08:00
|
|
|
with:
|
|
|
|
changelog_file: website/src/pages/changelog.md
|
2022-02-16 17:51:17 +08:00
|
|
|
archive_regex: '(?<=## )最近更新(?=\n)'
|
2022-02-15 23:39:04 +08:00
|
|
|
archive_title: ${{ env.TAG_NAME }}
|
2022-02-16 14:28:44 +08:00
|
|
|
commit_and_push: false
|
2022-02-14 21:54:38 +08:00
|
|
|
|
2022-02-16 11:49:45 +08:00
|
|
|
- name: Archive Files
|
2022-02-16 14:28:44 +08:00
|
|
|
run: |
|
|
|
|
yarn archive $(poetry version -s)
|
|
|
|
yarn prettier
|
2022-02-16 11:49:45 +08:00
|
|
|
|
2022-02-14 21:01:39 +08:00
|
|
|
- name: Push Tag
|
2021-12-02 03:17:10 +08:00
|
|
|
run: |
|
2023-04-04 09:48:31 +08:00
|
|
|
git config user.name noneflow[bot]
|
|
|
|
git config user.email 129742071+noneflow[bot]@users.noreply.github.com
|
2021-12-02 03:17:10 +08:00
|
|
|
git add .
|
|
|
|
git commit -m ":bookmark: Release $(poetry version -s)"
|
2022-02-15 23:39:04 +08:00
|
|
|
git tag ${{ env.TAG_NAME }}
|
2022-01-08 17:47:29 +08:00
|
|
|
git push && git push --tags
|