From 60e00a92e9d99c0198befc586a201710e01982f2 Mon Sep 17 00:00:00 2001 From: Tihomir Krasimirov Mateev Date: Thu, 6 Jun 2024 19:43:02 +0300 Subject: [PATCH] Add release drafter workflow (#2820) * Release-drafter, dependabot, OCD polishing * Commitish not needed and pointing to the wrong branch anyway, also wrong version chosen * Pipeline is also very confusing as there are many pipelines, this is the INTEGRATION pipeline * Adding commitish, as it is required for filter-by-commitish * Autolabeling hits issues when using pull_request, using pull_request_target instead * pull_request_target does nothing, trying the other suggestion from https://github.com/release-drafter/release-drafter/issues/1125 --- .github/dependabot.yml | 9 ++++ .github/release-drafter-config.yml | 44 +++++++++++++++++++ .github/workflows/{codeql.yaml => codeql.yml} | 2 +- .../workflows/{cicd.yaml => integration.yml} | 2 +- .github/workflows/release-drafter.yml | 32 ++++++++++++++ .../{spellcheck.yaml => spellcheck.yml} | 2 +- 6 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/release-drafter-config.yml rename .github/workflows/{codeql.yaml => codeql.yml} (97%) rename .github/workflows/{cicd.yaml => integration.yml} (97%) create mode 100644 .github/workflows/release-drafter.yml rename .github/workflows/{spellcheck.yaml => spellcheck.yml} (93%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..e0aea65c2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 + +updates: + - package-ecosystem: "maven" + directory: "/" + labels: + - "type: dependency-upgrade" + schedule: + interval: "weekly" diff --git a/.github/release-drafter-config.yml b/.github/release-drafter-config.yml new file mode 100644 index 000000000..ee3ae3ad2 --- /dev/null +++ b/.github/release-drafter-config.yml @@ -0,0 +1,44 @@ +name-template: '$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' +filter-by-commitish: true +commitish: main + +autolabeler: + - label: 'type: documentation' + files: + - '*.md' + - '.github/*' + - label: 'type: task' + files: + - '.github/*' + - label: 'type: dependency-upgrade' + files: + - 'pom.xml' + +categories: + - title: '🔥 Breaking Changes' + labels: + - 'breakingchange' + - 'type: breaking' + - title: '🚀 New Features' + labels: + - 'type: enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'type: bug' + - title: '🧰 Maintenance' + labels: + - 'type: documentation' + - 'type: dependency-upgrade' + - 'type: task' + +change-template: '- $TITLE (#$NUMBER)' +exclude-labels: + - 'skip-changelog' + +template: | + # Changes + $CHANGES + ## Contributors + We'd like to thank all the contributors who worked on this release! + $CONTRIBUTORS diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yml similarity index 97% rename from .github/workflows/codeql.yaml rename to .github/workflows/codeql.yml index 27aa7f3e4..fa90a8e24 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yml @@ -1,4 +1,4 @@ -name: "CodeQL analysis" +name: CodeQL analysis on: push: diff --git a/.github/workflows/cicd.yaml b/.github/workflows/integration.yml similarity index 97% rename from .github/workflows/cicd.yaml rename to .github/workflows/integration.yml index 692738de4..938cc30f4 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/integration.yml @@ -1,4 +1,4 @@ -name: CI / CD Pipeline +name: Continuous Integration on: push: paths-ignore: diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 000000000..8461e501f --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,32 @@ +name: Release Drafter + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - '[0-9].*' + # pull_request event is required only for autolabeler + pull_request: + 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: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + config-name: release-drafter-config.yml + commitish: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/spellcheck.yaml b/.github/workflows/spellcheck.yml similarity index 93% rename from .github/workflows/spellcheck.yaml rename to .github/workflows/spellcheck.yml index 943d54098..f3239f240 100644 --- a/.github/workflows/spellcheck.yaml +++ b/.github/workflows/spellcheck.yml @@ -1,4 +1,4 @@ -name: Spellcheck Action +name: Spellcheck on: pull_request: jobs: