diff --git a/Dockerfile.semantic-release-gitlab b/Dockerfile.semantic-release-gitlab index 0fab16d3a64d6cce263d753b36fefcd7ff2865e4..98913fbd87b40ee68888147852f6eb2217dd4863 100644 --- a/Dockerfile.semantic-release-gitlab +++ b/Dockerfile.semantic-release-gitlab @@ -5,6 +5,7 @@ LABEL maintainer="eole@ac-dijon.fr" ARG SEMANTIC_RELEASE_VERSION=19 ARG SEMAINTIC_GITLAB_VERSION=7 ARG SEMAINTIC_CHANGELOG_VERSION=6 +ARG CONVENTIONALCOMMITS_VERSION=4 ARG SEMAINTIC_EXEC_VERSION=6 ARG SEMAINTIC_GIT_VERSION=10 ARG SEMANTIC_NPM_VERSION=9 @@ -28,4 +29,5 @@ RUN npm install -g semantic-release@${SEMAINTIC_RELEASE_VERSION} \ @semantic-release/exec@${SEMAINTIC_EXEC_VERSION} \ @semantic-release/git@${SEMAINTIC_GIT_VERSION} \ @semantic-release/npm@${SEMAINTIC_NPM_VERSION} \ + conventional-changelog-conventionalcommits@${CONVENTIONALCOMMITS_VERSION} \ semantic-release-pypi@${SEMANTIC_PYPI_VERSION} diff --git a/release.config.js b/release.config.js index 275d6422122e0284c49f3ccbc748de5f4f84da3b..f67bcb2c45ae92425e78f0b31489d54d4b52058a 100644 --- a/release.config.js +++ b/release.config.js @@ -22,6 +22,25 @@ const devBranch = undefined; const breakingKeywords = ["BREAKING CHANGE", "BREAKING-CHANGE", "BREAKING CHANGES", "BREAKING-CHANGES"]; const changelogFile = 'docs/CHANGELOG.md'; +// Configure `conventionalcommits` +// See: +// - https://github.com/conventional-changelog/conventional-changelog/issues/838 +// - https://github.com/conventional-changelog/conventional-changelog/issues/317 +// - https://github.com/conventional-changelog/conventional-changelog/pull/421 +const commitTypes = [ + {type: "build", section: "Build System", hidden: false}, + {type: "chore", section: "Maintenance", hidden: true}, + {type: "ci", section: "Continuous Integration", hidden: false}, + {type: "docs", section: "Documentation", hidden: false}, + {type: "feat", section: "Features", hidden: false}, + {type: "fix", section: "Bug Fixes", hidden: false}, + {type: "perf", section: "Performance Improvements", hidden: false}, + {type: "refactor", section: "Code Refactoring", hidden: false}, + {type: "revert", section: "Reverts", hidden: false}, + {type: "style", section: "Styles", hidden: false}, + {type: "test", section: "Tests", hidden: false}, +]; + const semanticBranches = [stableBranch]; if (betaBranch) { @@ -53,22 +72,30 @@ const config = { [ '@semantic-release/commit-analyzer', { - preset: 'angular', + preset: 'conventionalcommits', parserOpts: { noteKeywords: breakingKeywords, }, releaseRules: './release-rules.js', + presetConfig: + { + types: commitTypes, + }, }, ], [ '@semantic-release/release-notes-generator', { - preset: 'angular', + preset: 'conventionalcommits', parserOpts: { noteKeywords: breakingKeywords, }, + presetConfig: + { + types: commitTypes, + }, }, ], ],