From a83ae87b8a6574d484df40191bacb5039f958208 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Mon, 5 Feb 2024 02:40:06 +0800 Subject: [PATCH 1/2] chore: Add labels Add Breaking change label and Skip-Changelog label --- .github/settings.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/settings.yml b/.github/settings.yml index a9fff4b..e2467b0 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,4 +1,8 @@ labels: + - name: "Type: Breaking" + color: a90000 + description: A problem or enhancement related to a breaking change. + - name: "Type: Bug" color: e80c0c description: Something isn't working as expected. @@ -78,3 +82,7 @@ labels: - name: "Os: Linux" color: AEB1C2 description: Is Linux-specific + + - name: "Skip-Changelog" + color: AEB1C2 + description: Skip changelog in release tag From 406ebb2923535a5327e24282d7af6e75f829724d Mon Sep 17 00:00:00 2001 From: AlexNg Date: Mon, 5 Feb 2024 02:42:47 +0800 Subject: [PATCH 2/2] chore: Add auto release drafting Utilizing the external release-drafter gh action --- .github/release-drafter.yml | 42 +++++++++++++++++++++++++ .github/workflows/draft-release-tag.yml | 27 ++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/draft-release-tag.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..da66d58 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,42 @@ +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +template: | + # What's Changed + + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION + + +categories: + - title: 'New' + label: 'Type: Feature' + + - title: 'Bug Fixes' + label: 'Type: Bug' + + - title: 'Improvements' + label: 'Type: Enhancement' + + - title: 'Other changes' + + - title: 'Documentation' + label: 'Documentation' + collapse-after: 5 + + +version-resolver: + major: + labels: + - 'Type: Breaking' + minor: + labels: + - 'Type: Feature' + patch: + labels: + - 'Type: Bug' + - 'Documentation' + - 'Type: Security' + +exclude-labels: + - 'Skip-Changelog' \ No newline at end of file diff --git a/.github/workflows/draft-release-tag.yml b/.github/workflows/draft-release-tag.yml new file mode 100644 index 0000000..19c47a5 --- /dev/null +++ b/.github/workflows/draft-release-tag.yml @@ -0,0 +1,27 @@ +name: Release Drafter + + +on: + push: + branches: + - main + + +permissions: + contents: read + + +jobs: + update_release_draft: + permissions: + contents: write + pull-requests: read + + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + disable-autolabeler: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file