module.exports = {
"branches": ["main"],
"plugins": [
[
"@semantic-release/commit-analyzer"
, {
preset: "angular"
, releaseRules: [
{type: "config", release: "patch"} // Treat config changes as a patch
, {type: "feat", release: "minor"} // Features trigger a minor release
, {type: "fix", release: "patch"} // Bug fixes trigger a patch release
, {type: "perf", release: "patch"} // Performance improvements as patches
, {type: "refactor", release: "patch"} // Refactors treated as patches
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
}
}
] // Analyzes commit messages to determine version bumps
, [
"@semantic-release/release-notes-generator"
, {
preset: "conventionalcommits"
, presetConfig: {
types: [
{type: "config", section: "Configuration Updates"} // Categorizes config updates
, {type: "feat", section: "Features"} // Features section
, {type: "fix", section: "Bug Fixes"} // Bug fixes section
, {type: "perf", section: "Performance Improvements"} // Performance improvements section
, {type: "chore", hidden: true} // Hide chore commits from release notes
, {type: "docs", hidden: true} // Hide documentation changes
, {type: "refactor", section: "Code Refactoring"} // Refactoring section
, {type: "style", hidden: true} // Hide style changes
, {type: "test", hidden: true} // Hide test changes
]
}
, parserOpts: {
noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES"] // Identify breaking changes in release notes
}
}
], // Generates release notes from commit history
"@semantic-release/changelog",
[
"@semantic-release/git"
, {
assets: ["CHANGELOG.md"]
}
], // Commits only changelog
"@semantic-release/gitlab"
]
}