# =============================================================================
# release-drafter-semver-template.yml — Release Drafter configuration for chrom-rs
# =============================================================================
# Referenced by: .github/workflows/release-drafter.yml
# Versioning scheme: SemVer vX.Y.Z
#
# Label → category mapping follows the label schema (chromatography-labels.yml).
# Categories are ordered by descending importance in the release notes.
# =============================================================================

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

# Version resolution from labels
version-resolver:
  major:
    labels:
      - "type: breaking"
  minor:
    labels:
      - "type: feature"
      - "type: deprecation"
  patch:
    labels:
      - "type: bug"
      - "type: perf"
      - "type: refactor"
      - "type: docs"
      - "type: ci"
      - "type: chore"
      - "type: test"
      - "type: security"
  default: patch

categories:
  - title: "⚠️ Breaking Changes"
    labels:
      - "type: breaking"

  - title: "✨ New Features"
    labels:
      - "type: feature"

  - title: "🐛 Bug Fixes"
    labels:
      - "type: bug"

  - title: "⚡ Performance"
    labels:
      - "type: perf"

  - title: "🔒 Security"
    labels:
      - "type: security"

  - title: "🏗️ Architecture Decisions"
    labels:
      - "type: decision"

  - title: "⏰ Deprecations"
    labels:
      - "type: deprecation"

  - title: "♻️ Refactoring"
    labels:
      - "type: refactor"

  - title: "📖 Documentation"
    labels:
      - "type: docs"

  - title: "🧪 Tests"
    labels:
      - "type: test"

  - title: "🔧 Maintenance"
    labels:
      - "type: chore"
      - "type: ci"

  - title: "📦 Other Changes"
    labels:
      - "default"

# PRs excluded from release notes entirely
exclude-labels:
  - "status: duplicate"
  - "status: wontfix"
  - "status: invalid"

# Release notes template
template: |
  ## What's Changed

  $CHANGES

  ---

  ### Quality gates
  <!-- Verify before publishing the release -->
  | Gate | Command | Status |
  |------|---------|--------|
  | Clippy | `cargo clippy -- -D warnings` | <!-- ✅ / ❌ --> |
  | Tests | `cargo test --all-features` | <!-- ✅ / ❌ --> |
  | Doc-tests | `cargo test --doc` | <!-- ✅ / ❌ --> |
  | Coverage | `cargo llvm-cov` ≥ 80 % | <!-- ✅ / ❌ --> |
  | Semver | No breaking change in patch/minor | <!-- ✅ / ❌ --> |

  **Full Changelog**: $PREVIOUS_TAG...v$RESOLVED_VERSION

autolabeler:
  - label: "type: docs"
    files:
      - "*.md"
      - "docs/**"
  - label: "type: ci"
    files:
      - ".github/**"
      - ".codecov.yml"
  - label: "type: test"
    files:
      - "tests/**"
