{
  "branches": ["main"],
  "tagFormat": "v${version}",
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "conventionalcommits",
        "releaseRules": [
          { "type": "feat", "release": "minor" },
          { "type": "fix", "release": "patch" },
          { "type": "perf", "release": "patch" },
          { "type": "refactor", "release": "patch" },
          { "type": "revert", "release": "patch" },
          { "type": "docs", "release": false },
          { "type": "style", "release": false },
          { "type": "chore", "release": false },
          { "type": "test", "release": false },
          { "type": "build", "release": false },
          { "type": "ci", "release": false },
          { "breaking": true, "release": "major" }
        ],
        "parserOpts": {
          "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
        }
      }
    ],
    [
      "@semantic-release/release-notes-generator",
      {
        "preset": "conventionalcommits",
        "presetConfig": {
          "types": [
            { "type": "feat", "section": "✨ Features" },
            { "type": "fix", "section": "🐛 Fixes" },
            { "type": "perf", "section": "⚡ Performance" },
            { "type": "refactor", "section": "♻️ Refactoring" },
            { "type": "revert", "section": "⏪ Reverts" },
            { "type": "docs", "section": "📝 Docs", "hidden": false },
            { "type": "chore", "hidden": true },
            { "type": "test", "hidden": true },
            { "type": "ci", "hidden": true },
            { "type": "build", "hidden": true },
            { "type": "style", "hidden": true }
          ]
        }
      }
    ],
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "CHANGELOG.md",
        "changelogTitle": "# Ordinis Release Notes\n\nAuto-generated by semantic-release based on conventional commits.\nSee `.releaserc.json` for release rules."
      }
    ],
    [
      "@semantic-release/npm",
      {
        "npmPublish": false
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": ["package.json", "CHANGELOG.md"],
        "_comment": "БЕЗ [skip ci]: tag pipeline на этом commit'е (через @semantic-release/gitlab) ДОЛЖЕН запускаться чтобы собрать images с tag'ом v*-*-*-<sha>. Без images = nothing для deploy на prod (см. ordinis-infra MR !10 + ordinis MR !154 auto-PR flow). Защита от loop: chore(release) тип имеет 'release: false' в releaseRules выше → semantic-release на этом chore-commit'е выйдет 0 (no releasable commits) → не создаст новый tag. Cost: docker-admin-ui ребилдит на каждом release commit (package.json + CHANGELOG.md changes match frontend-changes) — ~2 мин waste, приемлемо.",
        "message": "chore(release): v${nextRelease.version}\n\n${nextRelease.notes}"
      }
    ],
    [
      "@semantic-release/gitlab",
      {
        "gitlabUrl": "https://git.nstart.cloud"
      }
    ]
  ]
}
