From e9eba4efa30b55adfaac384006748c372bba5f22 Mon Sep 17 00:00:00 2001 From: river Date: Wed, 24 Jan 2024 23:30:32 +0800 Subject: [PATCH] chore(): add release-drafter configuration (main) --- .github/release-drafter.yml | 43 +++++++++++++++++++++++++++++ .github/workflows/release-draft.yml | 38 +++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-draft.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..18b77ff --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,43 @@ +# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter +name-template: 'v$NEXT_PATCH_VERSION 🌈' +tag-template: 'v$NEXT_PATCH_VERSION' +version-template: $MAJOR.$MINOR.$PATCH +# Emoji reference: https://gitmoji.carloscuesta.me/ +categories: + - title: πŸš€ Features + labels: + - 'feature' + - 'enhancement' + - 'kind/feature' + - title: πŸš‘οΈ Bug Fixes + labels: + - 'fix' + - 'bugfix' + - 'bug' + - 'regression' + - 'kind/bug' + - title: πŸ“ Documentation updates + labels: + - 'doc' + - 'documentation' + - 'kind/doc' + - title: πŸ‘· Maintenance + labels: + - refactor + - chore + - dependencies + - 'kind/chore' + - 'kind/dep' + - title: 🚦 Tests + labels: + - test + - tests +exclude-labels: + - reverted + - no-changelog + - skip-changelog + - invalid +change-template: '* $TITLE (#$NUMBER) @$AUTHOR' +template: | + ## What’s Changed + $CHANGES diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml new file mode 100644 index 0000000..9b87996 --- /dev/null +++ b/.github/workflows/release-draft.yml @@ -0,0 +1,38 @@ +name: Release Drafter + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - main + # pull_request event is required only for autolabeler + pull_request: + # Only following types are handled by the action, but one can default to all as well + types: [opened, reopened, synchronize] + # pull_request_target event is required for autolabeler to support PRs from forks + # pull_request_target: + # types: [opened, reopened, synchronize] + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + contents: write # for release-drafter/release-drafter to create a github release + pull-requests: write # for release-drafter/release-drafter to add label to PR + runs-on: ubuntu-latest + steps: + # (Optional) GitHub Enterprise requires GHE_HOST variable set + #- name: Set GHE_HOST + # run: | + # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV + + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + # with: + # config-name: my-config.yml + # disable-autolabeler: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}