From bf63cb84fda12dea66c012211ae1f165546b369d Mon Sep 17 00:00:00 2001 From: Matt Ketmo Date: Fri, 8 Nov 2024 11:05:32 +0100 Subject: [PATCH] chore: add release-drafter workflow (#12) --- .github/release-drafter.yml | 51 ++++++++++++++++++++++++++ .github/workflows/pr-title.yaml | 29 +++++++++++++++ .github/workflows/release-drafter.yaml | 22 +++++++++++ 3 files changed, 102 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/pr-title.yaml 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..7591c77 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,51 @@ +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +change-template: '* $TITLE (#$NUMBER) by @$AUTHOR' +template: | + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION + +sort-direction: ascending + +categories: + - title: '⚠ī¸ BREAKING CHANGES' + label: 'breaking' + - title: 'đŸ’Ģ Features' + label: 'feature' + - title: '🛠ī¸ Bug fixes' + label: 'fix' + - title: '🕹ī¸ Others' + label: 'chore' + +version-resolver: + # Major is not meant to be used at the moment. + # Should be used with label breaking in the future. + major: + labels: + - 'major' + minor: + labels: + - 'breaking' + - 'feature' + - 'chore' + patch: + labels: + - 'fix' + +exclude-labels: + - 'skip-changelog' + +autolabeler: + - label: 'breaking' + title: + - '/!:/i' + - label: 'chore' + title: + - '/^chore/i' + - label: 'fix' + title: + - '/^fix/i' + - label: 'feature' + title: + - '/^feat/i' diff --git a/.github/workflows/pr-title.yaml b/.github/workflows/pr-title.yaml new file mode 100644 index 0000000..f6064af --- /dev/null +++ b/.github/workflows/pr-title.yaml @@ -0,0 +1,29 @@ +name: 'Validate PR title' + +on: + pull_request: + branches: [ main ] + types: [ opened, reopened, synchronize ] + +permissions: + pull-requests: read + statuses: write + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + # Please look up the latest version from + # https://github.com/amannn/action-semantic-pull-request/releases + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + fix + feat + chore + requireScope: false + wip: true + validateSingleCommit: false diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml new file mode 100644 index 0000000..49a0a21 --- /dev/null +++ b/.github/workflows/release-drafter.yaml @@ -0,0 +1,22 @@ +name: Release Drafter + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}