Skip to content
Snippets Groups Projects
Commit 07950c4c authored by Daniel Dehennin's avatar Daniel Dehennin
Browse files

feat(semantic-release): switch to `conventionalcommits` changelog

The `conventional-changelog-conventionalcommits` permits to easily
configure which commit types are rendered or not in the changelog and
releases.

* Dockerfile.semantic-release-gitlab: the module must be installed.

* release.config.js: switch to `conventionalcommits` and configure the
  commit `types`.
parent 98d6ebca
No related branches found
No related tags found
No related merge requests found
......@@ -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}
......@@ -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,
},
},
],
],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment