diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml new file mode 100644 index 0000000..cb23c17 --- /dev/null +++ b/.github/pr-labeler.yml @@ -0,0 +1,34 @@ +# +# @see https://github.com/grafana/pr-labeler-action +# +# 是否将缺失的标签添加到存储库 +add-missing-labels: true +# 是否从PR中删除先前存在的标签以支持生成的标签 +clear-prexisting: true +# 添加标签时考虑PR提交消息 +include-commits: false +# 添加标签时考虑公关标题 +include-title: true +# 当消息具有破坏性更改语法时使用标签'!:',例如:'feat!:' +label-for-breaking-changes: break +# 标签到类型数组以进行映射 +label-mapping: + # 增强 + enhancement: [feat, feature] + # 修复 + bugfix: [fix, bug] + # 维护 + maintenance: [chore, perf, refactor, security, style] + # 文档 + documentation: [docs] + # 依赖/构建 + configuration: [config, deps, build, ci] + # 测试 + test: [test] + # 其他 + other: + - other + - misc + - types + - release + - revert diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..b631c1b --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,48 @@ +name-template: 🏷 v$RESOLVED_VERSION +tag-template: v$RESOLVED_VERSION +categories: + - title: 🚀 新特性 + labels: + - enhancement + - title: 🐛 修复 + labels: + - bugfix + - title: 🧰 维护 + labels: + - maintenance + - security + - title: 📝 文档 + labels: + - documentation + - title: 📦 构建 + labels: + - configuration + - title: 🚧 其他 + labels: + - test + - other +change-template: '- $TITLE (#$NUMBER) @$AUTHOR\n - $BODY' +change-title-escapes: '\<*_`&' +exclude-contributors: + - renovate + - renovate[bot] + - dependabot +version-resolver: + major: + labels: + - major + minor: + labels: + - minor + patch: + labels: + - patch + default: patch +template: | + ## 更新日志 + + $CHANGES + + ## 贡献者 + + $CONTRIBUTORS diff --git a/.github/workflows/ci.yml b/.github/workflows/check.yml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/check.yml diff --git a/.github/workflows/label-prs.yml b/.github/workflows/label-prs.yml new file mode 100644 index 0000000..3ba574a --- /dev/null +++ b/.github/workflows/label-prs.yml @@ -0,0 +1,14 @@ +name: PR Labelers +# +# @see https://github.com/grafana/pr-labeler-action +# +on: + pull_request: + +jobs: + label-pr: + runs-on: ubuntu-latest + steps: + - uses: grafana/pr-labeler-action@v0.1.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..e3badf0 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,22 @@ +name: Release Drafter + +on: + push: + branches: + - main + pull_request: + types: [opened, reopened, synchronize] + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 2b5acbc..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Release - -on: - push: - tags: - - 'v*' - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - - run: npx changelogithub - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}