From 97bcea99afee42b772794dd7bf20de7f8a9d2f28 Mon Sep 17 00:00:00 2001 From: Khanh Nguyen Date: Thu, 8 Aug 2024 10:52:35 +0700 Subject: [PATCH 1/2] Add release-drafter workflow --- .github/release-drafter.yml | 39 +++++++++++++++++++++++++ .github/workflows/release-drafter.yml | 41 +++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..32944b4f2 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,39 @@ +name-template: 'v$RESOLVED_VERSION ๐Ÿงช' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: '๐Ÿš€ Features' + labels: + - 'feature' + - 'enhancement' + - title: '๐Ÿ› Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '๐Ÿ“ฆ Dependencies' + label: 'dependencies' + - title: โš ๏ธ Changes + labels: + - deprecated + - title: ๐Ÿ“„ Documentation + labels: + - docs + - documentation +exclude-labels: + - 'skip-changelog' +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 +template: | + ## Changes + $CHANGES \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 000000000..5f1474644 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,41 @@ +name: Release Drafter + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - master + # 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: + # write permission is required to create a github release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: write + 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@v6 + # (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 }} \ No newline at end of file From 83e5eddf8fecc706ed7b8452b01002969f6348a5 Mon Sep 17 00:00:00 2001 From: Khanh Nguyen Date: Thu, 8 Aug 2024 14:36:32 +0700 Subject: [PATCH 2/2] Update release drafter workflow --- .github/release-drafter.yml | 14 +++++++++++++- .github/workflows/release-drafter.yml | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 32944b4f2..db31cd5aa 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -36,4 +36,16 @@ version-resolver: default: patch template: | ## Changes - $CHANGES \ No newline at end of file + $CHANGES +autolabeler: + - label: 'chore' + branch: + - '/chore\/.+/' + - label: 'bug' + branch: + - '/bug\/.+/' + - '/bugfix\/.+/' + - '/hotfix\/.+/' + - label: 'feature' + branch: + - '/feature\/.+/' \ No newline at end of file diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 5f1474644..73d7ee6a7 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -34,8 +34,8 @@ jobs: # Drafts your next Release notes as Pull Requests are merged into "master" - uses: release-drafter/release-drafter@v6 # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # with: - # config-name: my-config.yml - # disable-autolabeler: true + with: + config-name: release-drafter.yml + disable-autolabeler: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file