Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Release-drafter configuration.
#
# Drafts release notes by reading the conventional-commit prefix of each
# merged PR title (squash-merge subject) and grouping into the categories
# below. Categories map 1:1 to the [tool.commitizen].customize.schema_pattern
# types enforced by `Lint PR title` CI; see check_commit_types.py.

name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"

categories:
- title: "Features"
labels:
- "feat"
- title: "Fixes"
labels:
- "fix"
- title: "Housekeeping"
labels:
- "chore"
- "docs"
- "refactor"
- "test"
- "release"

# Match conventional-commit prefixes against PR titles regardless of label —
# release-drafter assigns the synthetic label so the categories above resolve
# even when the PR doesn't carry a manual label.
autolabeler:
- label: "feat"
title:
- "/^feat(\\(.+\\))?:/i"
- label: "fix"
title:
- "/^fix(\\(.+\\))?:/i"
- label: "chore"
title:
- "/^chore(\\(.+\\))?:/i"
- label: "docs"
title:
- "/^docs(\\(.+\\))?:/i"
- label: "refactor"
title:
- "/^refactor(\\(.+\\))?:/i"
- label: "test"
title:
- "/^test(\\(.+\\))?:/i"
- label: "release"
title:
- "/^release(\\(.+\\))?:/i"

# SemVer resolver:
# - any `feat` PR since the last release → minor bump
# - any `fix` PR with no `feat` → patch bump
# - everything else (chore/docs/refactor/test/release-only) → patch bump
# `major` is not auto-resolved — major bumps are deliberate human calls.
version-resolver:
minor:
labels:
- "feat"
patch:
labels:
- "fix"
- "chore"
- "docs"
- "refactor"
- "test"
- "release"
default: patch

template: |
## What's changed in v$RESOLVED_VERSION

$CHANGES

**Full changelog:** https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

change-template: "- $TITLE ([#$NUMBER]($URL))"
change-title-escapes: '\<*_&' # escape markdown control chars in PR titles

exclude-labels:
- "skip-changelog"
31 changes: 31 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Drafter

# Updates a draft GitHub Release on every push to `main` and on PR
# label / open / reopen events. The drafted release body becomes the
# `release.yml` workflow's input on tag push (see release.yml).
#
# Single-source-of-truth: the categories + version-resolver in
# .github/release-drafter.yml mirror the conventional-commit prefixes
# enforced by check_commit_types.py and the `Lint PR title` job.

on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
branches: [main]

permissions:
contents: write # create/update draft releases
pull-requests: read

jobs:
draft:
runs-on: ubuntu-latest
name: Draft next release
steps:
- uses: release-drafter/release-drafter@6a93d829887aa2e0748befe2e808c66c0ec6e4c7 # v6
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading