Skip to content

Commit

Permalink
版本更新
Browse files Browse the repository at this point in the history
  • Loading branch information
HibiKier committed Oct 20, 2024
1 parent 4e33bf3 commit d594d17
Show file tree
Hide file tree
Showing 253 changed files with 34,986 additions and 2,240 deletions.
77 changes: 77 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
template: $CHANGES
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
exclude-labels:
- reverted
- no-changelog
- skip-changelog
- invalid
autolabeler:
- label: "bug"
title:
- "/:bug:.+/"
- "/🐛.+/"
- label: "enhancement"
title:
- "/:sparkles:.+/"
- "/✨.+/"
- label: "ci"
files:
- .github/**/*
- label: "breaking-change"
title:
- "/.+!:.+/"
- label: "documentation"
files:
- "*.md"
- label: "dependencies"
files:
- "pyproject.toml"
- "requirements.txt"
- "poetry.lock"
title:
- "/:wrench:.+/"
- "/🔧.+/"
- label: "resources"
files:
- resources/**/*
categories:
- title: 💥 破坏性变更
labels:
- breaking-change
- title: 🚀 新功能
labels:
- enhancement
- title: 🐛 Bug 修复
labels:
- bug
- title: 📝 文档更新
labels:
- documentation
- title: 👻 自动化程序
labels:
- chore
- internal
- maintenance
- title: 🚦 测试
labels:
- test
- tests
- title: 📦 依赖更新
labels:
- dependencies
collapse-after: 15
- title: 💫 杂项
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: patch
18 changes: 18 additions & 0 deletions .github/workflows/release_draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release Drafter

on:
push:
branches:
- main
- dev
pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
name: Update Release Draft
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
73 changes: 73 additions & 0 deletions .github/workflows/update_version_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Update Version

on:
push:
paths:
- .github/workflows/update_version_pr.yml
- zhenxun/**
- resources/**
- bot.py
branches:
- main
- dev

jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}

- name: Read current version
id: read_version
run: |
version_line=$(grep '__version__' __version__)
version=$(echo $version_line | sed -E 's/__version__:\s*v([0-9]+\.[0-9]+\.[0-9]+)(-.+)?/\1/')
echo "Current version: $version"
echo "current_version=$version" >> $GITHUB_OUTPUT
- name: Check for version file changes
id: check_diff
run: |
if git diff --name-only HEAD~1 HEAD | grep -q '__version__'; then
echo "Version file has changes"
echo "version_changed=true" >> $GITHUB_OUTPUT
else
echo "Version file has no changes"
echo "version_changed=false" >> $GITHUB_OUTPUT
fi
- name: Get commit hash
id: get_commit_hash
run: echo "commit_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Update version file
id: update_version
if: steps.check_diff.outputs.version_changed == 'false'
run: |
current_version="${{ steps.read_version.outputs.current_version }}"
commit_hash="${{ steps.get_commit_hash.outputs.commit_hash }}"
new_version="v${current_version}-${commit_hash}"
echo "new_version=$new_version" >> $GITHUB_OUTPUT
echo "Updating version to: $new_version"
echo "__version__: $new_version" > __version__
- name: Check updated version
if: steps.check_diff.outputs.version_changed == 'false'
run: cat __version__

- name: Create or update PR
if: steps.check_diff.outputs.version_changed == 'false'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GH_TOKEN }}
branch: create-pr/update_version
title: ":tada: chore(version): 自动更新版本到 ${{ steps.update_version.outputs.new_version }}"
body: "This PR updates the version file."
commit-message: ":tada: chore(version): Update version to ${{ steps.update_version.outputs.new_version }}"
add-paths: __version__
author: "AkashiCoin <i@loli.vet>"
committer: "${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>"
labels: automated-update
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
| :-----------------------------------------------------------: | :--: | :----------------------: | :--: |
| [LLOneBot](https://github.com/LLOneBot/LLOneBot) | NTQQ | linyuchen | 可用 |
| [Napcat](https://github.com/NapNeko/NapCatQQ) | NTQQ | NapNeko | 可用 |
| [Lagrange.Core](https://github.com/LagrangeDev/Lagrange.Core) | | LagrangeDev/Linwenxuan04 | 可用 |
| [Lagrange.Core](https://github.com/LagrangeDev/Lagrange.Core) | NTQQ | LagrangeDev/Linwenxuan04 | 可用 |

</div>

Expand Down
2 changes: 1 addition & 1 deletion __version__
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: v0.2.3
__version__: v0.2.4
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

nonebot.init()

from zhenxun.services.db_context import disconnect, init

driver = nonebot.get_driver()
driver.register_adapter(OneBotV11Adapter)
driver.register_adapter(KaiheilaAdapter)
driver.register_adapter(DoDoAdapter)
# driver.register_adapter(DiscordAdapter)

from zhenxun.services.db_context import init, disconnect

driver.on_startup(init)
driver.on_shutdown(disconnect)
Expand Down
Loading

0 comments on commit d594d17

Please # to comment.