From f719240c30aa4488a3c709486fa74689646fb0eb Mon Sep 17 00:00:00 2001 From: the_hunter Date: Fri, 11 Aug 2023 21:03:13 +0300 Subject: [PATCH] ci: add Release Drafter workflow --- .github/release-drafter.yml | 165 ++++++++++++++++++++++++++ .github/workflows/release-drafter.yml | 33 ++++++ 2 files changed, 198 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 0000000..9bbe925 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,165 @@ +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 + +autolabeler: + - label: 'breaking' + body: + - '/BREAKING CHANGE: .+/i' + title: + - '/!:/' + + - label: 'bug' + branch: + - '/fix\/.+/' + title: + - '/fix: .+/' + + - label: 'build' + files: + - '*.cmake' + - '**/cmake/**' + - 'CMakeLists.txt' + - 'CMakePresets.json' + branch: + - '/build\/.+/' + title: + - '/build: .+/' + + - label: 'chore' + files: + - '.clang-tidy' + - '.cppcheck_suppressions' + - '.gitattributes' + - '.gitignore' + - '*.rc.in' + - 'LICENSE' + branch: + - '/chore\/.+/' + title: + - '/chore: .+/' + + - label: 'ci' + files: + - '.github/**' + branch: + - '/ci\/.+/' + title: + - '/ci: .+/' + + - label: 'documentation' + files: + - '*.md' + - '*.rst' + - 'docs/**' + branch: + - '/docs\/.+/' + title: + - '/docs: .+/' + + - label: 'enhancement' + branch: + - '/feat\/.+/' + title: + - '/feat: .+/' + + - label: 'improvement' + branch: + - '/improvement\/.+/' + title: + - '/improvement: .+/' + + - label: 'performance' + branch: + - '/perf\/.+/' + title: + - '/perf: .+/' + + - label: 'refactoring' + branch: + - '/refactor\/.+/' + title: + - '/refactor: .+/' + + - label: 'revert' + branch: + - '/revert\/.+/' + title: + - '/revert: .+/' + + - label: 'style' + files: + - '.clang-format' + - '.editorconfig' + branch: + - '/style\/.+/' + title: + - '/style: .+/' + + - label: 'tests' + files: + - '**/test/**' + branch: + - '/test\/.+/' + title: + - '/test: .+/' + +categories: + - title: ':warning: Breaking changes' + labels: + - 'breaking' + + - title: ':rocket: Features' + labels: + - 'enhancement' + + - title: ':thumbsup: Improvements' + labels: + - 'improvement' + - 'performance' + - 'refactoring' + + - title: ':bug: Bug Fixes' + labels: + - 'bug' + + # - title: ':books: Documentation' + # labels: + # - 'documentation' + + - title: ':white_check_mark: Tests' + labels: + - 'tests' + + - title: ':hammer: Maintenance' + labels: + - 'build' + - 'chore' + - 'ci' + - 'revert' + - 'style' + +version-resolver: + major: + labels: + - 'breaking' + + minor: + labels: + - 'enhancement' + + patch: + labels: + - 'bug' + - 'improvement' + - 'performance' + - 'refactoring' + +exclude-labels: + - 'skip-changelog' diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..784f360 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,33 @@ +name: Release Drafter + +on: + push: + branches: ["main"] + + pull_request: + types: ["opened", "reopened", "synchronize"] + + pull_request_target: + 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@v5 + with: + config-name: "release-drafter.yml" + publish: false + prerelease: false + disable-releaser: false + disable-autolabeler: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}