From 251a0faf591a07961cfb137d3cd9d9fe70db8299 Mon Sep 17 00:00:00 2001 From: tom twinkle Date: Mon, 14 Aug 2023 13:42:52 +0900 Subject: [PATCH] add release drafter --- .github/release-drafter.yml | 72 ++++++++++++++++++++++++++ .github/workflows/go-pr-release.yml | 4 ++ .github/workflows/release-drafter.yaml | 38 ++++++++++++++ .github/workflows/release.yml | 4 ++ .github/workflows/test.yml | 4 ++ 5 files changed, 122 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-drafter.yaml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..20d66d9 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,72 @@ +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' + +categories: + - title: '🚀 Features' + labels: + - 'feature' + - title: '💪 Enhancement' + labels: + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + label: 'chore' + - title: '🔧 Refactoring' + label: 'refactor' + - title: '📖 Documentation' + label: 'documentation' + - title: '⛓️ Dependency update' + label: 'dependencies' + +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: minor + +template: | + ## Changes + $CHANGES +autolabeler: + - label: feature + branch: + - '/^feat(ure)?[/-].+/' + - label: bug + branch: + - '/^fix[/-].+/' + - '/^hotfix[/-].+/' + - label: chore + branch: + - '/^chore[/-].+/' + - label: refactor + branch: + - '/(refactor|refactoring)[/-].+/' + - label: documentation + branch: + - '/doc(umentation)[/-].+/' + files: + - '*.md' + - label: enhancement + branch: + - '/(enhancement|improve)[/-].+/' + - label: github + files: + - '.github/**/*' + - label: patch + branch: + - '/(enhancement|improve)[/-].+/' + - '/doc(umentation)[/-].+/' diff --git a/.github/workflows/go-pr-release.yml b/.github/workflows/go-pr-release.yml index eed285f..eb8b2d0 100644 --- a/.github/workflows/go-pr-release.yml +++ b/.github/workflows/go-pr-release.yml @@ -5,6 +5,10 @@ on: branches: - develop +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: go-pr-release diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml new file mode 100644 index 0000000..52a04a9 --- /dev/null +++ b/.github/workflows/release-drafter.yaml @@ -0,0 +1,38 @@ +name: Release Drafter + +on: + push: + branches: + - main + pull_request: + types: + - opened + - synchronize + - reopened + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + update_release_draft: + permissions: + contents: write + 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@65c5fb495d1e69aa8c08a3317bc44ff8aabe9772 # v5.24.0 + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + # with: + # config-name: my-config.yml + # disable-autolabeler: true + with: + publish: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2093ef..34985d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: tags: - 'v[0-9]+\.[0-9]+\.[0-9]+' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: goreleaser: runs-on: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c86e611..a0bfec3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,10 @@ on: - synchronize - reopened +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: Test