diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..0d69836 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,101 @@ +name-template: "v$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" +autolabeler: + - label: "bug" + title: + - "/fix/i" + - label: "feature" + title: + - "/feat/i" + - label: "documentation" + title: + - "/docs/i" + - label: "ci" + title: + - "/ci/i" + - label: "style" + title: + - "/style/i" + - label: "refactor" + title: + - "/refactor/i" + - label: "performance" + title: + - "/perf/i" + - label: "test" + title: + - "/test/i" + - label: "chore" + title: + - "/chore/i" + - label: "breaking" + title: + - "/BREAKING CHANGE/i" + - '/\w+!:/i' + # Adding semantic versioning labels + - label: "major" + title: + - "/BREAKING CHANGE/i" + - '/\w+!:/i' + - label: "minor" + title: + - "/feat/i" + - label: "patch" + title: + - "/fix/i" +categories: + - title: "Breaking Changes" + labels: + - "breaking-change" + - title: "Notable Changes" + labels: + - "notable" + - title: "Features" + labels: + - "enhancement" + - "feature" + - title: "Performance Improvements" + labels: + - "performance" + - title: "Bug Fixes" + labels: + - "bug" + - title: "Documentation" + labels: + - "documentation" + - title: "Style Improvements" + labels: + - "style" + - title: "Maintenance" + labels: + - "chore" + - "deployment" + - "translation" + - "ci" + - "refactor" + - title: "Dependencies" + collapse-after: 3 + labels: + - "dependencies" + - title: "All App Changes" + collapse-after: 1 +exclude-labels: + - "skip-changelog" +category-template: "### $TITLE" +change-template: "- $TITLE @$AUTHOR ([#$NUMBER]($URL))" +change-title-escapes: '\<*_&#@' +template: | + ## v$RESOLVED_VERSION + + $CHANGES +version-resolver: + major: + labels: + - "major" + minor: + labels: + - "minor" + patch: + labels: + - "patch" + default: patch diff --git a/.github/workflows/pr-tagger.yml b/.github/workflows/pr-tagger.yml new file mode 100644 index 0000000..8e0f17b --- /dev/null +++ b/.github/workflows/pr-tagger.yml @@ -0,0 +1,26 @@ +name: PR Tagger + +on: + pull_request: + types: + - opened + - reopened + branches: + - main + +permissions: + contents: read + +jobs: + pr_opened_or_reopened: + name: pr_opened_or_reopened + runs-on: ubuntu-latest + permissions: + # write permission is required for autolabeler + pull-requests: write + if: github.event_name == 'pull_request_target' && (github.event.action == 'opened' || github.event.action == 'reopened') && github.event.pull_request.user.login != 'dependabot' + steps: + - name: Label PR with release-drafter + uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml deleted file mode 100644 index 7ee7c54..0000000 --- a/.github/workflows/prepare-release.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Prepare new release - -on: - workflow_dispatch: - inputs: - versionBump: - description: "Type of version bump (major, minor, patch)" - required: true - default: "patch" - type: choice - options: - - "false" - - "minor" - - "patch" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-root - cancel-in-progress: true - -jobs: - prepare_release: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Get tag - id: get_tag - run: | - git branch --show-current - git pull - echo "::set-output name=version::v$(pnpm pkg get version | tr -d '\"')" - - - name: Create release - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ steps.get_tag.outputs.version }} - name: v${{ steps.get_tag.outputs.version }} - # Automatically generate release notes based on commits - generate_release_notes: true - draft: true - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..cf482f8 --- /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: + - main + # pull_request event is required only for autolabeler + pull_request: + # Only following types are handled by the action, but one can default to all as well + types: [opened, reopened, synchronize] + # pull_request_target event is required for autolabeler to support PRs from forks + # pull_request_target: + # 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: read + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged + - uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file