I enabled Semantic Release for my Spring Boot Gradle project. From GitLab, I see that a version was released, but on the main branch, I don’t see the commit message generated by Semantic Release, and the gradle.properties file has not been updated
I expect to see the commit message generated to main by semantic release, and also version updated in gradle.properties file
.releaserc.json
{
"branches": [
"main"
],
"repositoryUrl": "https://gitlab.com/{my_repo}.git",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/gitlab",
"@semantic-release/release-notes-generator",
[
"@semantic-release/git",
{
"assets": [
"gradle.properties"
],
"message": "chore(release): ${nextRelease.version} [skip ci]nn${nextRelease.notes}"
}
]
]
}
.gitlab-ci.yml
stages:
- release
release:
image: maven:3.6.3-openjdk-11
stage: release
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_COMMIT_MESSAGE !~ /^chore(release)*/'
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
- apt-get install -y nodejs
- npm install @semantic-release/exec @semantic-release/git @semantic-release/gitlab @semantic-release/commit-analyzer @semantic-release/release-notes-generator
- git tag -d $(git tag -l)
- git fetch --tags -f
- npx semantic-release
gradle.properties
version=1.0.0
Log
$ npx semantic-release
[5:29:12 PM] [semantic-release] › ℹ Running semantic-release version 24.0.0
[5:29:12 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/gitlab"
[5:29:12 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/git"
[5:29:12 PM] [semantic-release] › ✔ Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[5:29:12 PM] [semantic-release] › ✔ Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[5:29:12 PM] [semantic-release] › ✔ Loaded plugin "prepare" from "@semantic-release/git"
[5:29:12 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/gitlab"
[5:29:12 PM] [semantic-release] › ✔ Loaded plugin "success" from "@semantic-release/gitlab"
[5:29:12 PM] [semantic-release] › ✔ Loaded plugin "fail" from "@semantic-release/gitlab"
[5:29:15 PM] [semantic-release] › ✔ Run automated release from branch main on repository https://gitlab.com/fakazza/jpmc.git
[5:29:15 PM] [semantic-release] › ✔ Allowed to push to the Git repository
[5:29:15 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/gitlab"
[5:29:15 PM] [semantic-release] [@semantic-release/gitlab] › ℹ Verify GitLab authentication (https://gitlab.com/api/v4)
[5:29:15 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/gitlab"
[5:29:15 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/git"
[5:29:15 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/git"
[5:29:15 PM] [semantic-release] › ℹ Found git tag v1.2.6 associated with version 1.2.6 on branch main
[5:29:15 PM] [semantic-release] › ℹ Found 1 commits since last release
[5:29:15 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[5:29:15 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ Analyzing commit: fix: trigger
[5:29:15 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ The release type for the commit is patch
[5:29:15 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ Analysis of 1 commits complete: patch release
[5:29:15 PM] [semantic-release] › ✔ Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[5:29:15 PM] [semantic-release] › ℹ The next release version is 1.2.7
[5:29:15 PM] [semantic-release] › ℹ Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[5:29:15 PM] [semantic-release] › ✔ Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[5:29:15 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/git"
[5:29:15 PM] [semantic-release] › ✔ Completed step "prepare" of plugin "@semantic-release/git"
[5:29:18 PM] [semantic-release] › ✔ Created tag v1.2.7
[5:29:18 PM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/gitlab"
[5:29:18 PM] [semantic-release] [@semantic-release/gitlab] › ℹ Published GitLab release: v1.2.7
[5:29:18 PM] [semantic-release] › ✔ Completed step "publish" of plugin "@semantic-release/gitlab"
[5:29:18 PM] [semantic-release] › ℹ Start step "success" of plugin "@semantic-release/gitlab"
[5:29:18 PM] [semantic-release] › ✔ Completed step "success" of plugin "@semantic-release/gitlab"
[5:29:18 PM] [semantic-release] › ✔ Published release 1.2.7 on default channel