Skip to content

chore: update releaserc to include pom.xml file #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 14, 2021
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ target/
## semantic-release
package-lock.json
node_modules/
pom.xml.versionsBackup
21 changes: 15 additions & 6 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@
"presetConfig": {
"types": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "fix", "section": "Fixes"},
{"type": "chore", "section": "Maintenance"},
{"type": "docs", "section": "Maintenance"},
{"type": "revert", "section": "Bug Fixes"},
{"type": "revert", "section": "Fixes"},
{"type": "style", "hidden": true},
{"type": "refactor", "hidden": true},
{"type": "perf", "hidden": true},
{"type": "test", "hidden": true}
]
}
},
"releaseRules": [
{"type": "docs", "release": "patch"},
{"type": "revert", "release": "patch"},
{"type": "chore", "release": "patch"}
]
}],
["@semantic-release/release-notes-generator", {
"preset": "conventionalcommits",
Expand All @@ -28,10 +33,10 @@
"presetConfig": {
"types": [
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "fix", "section": "Fixes"},
{"type": "chore", "section": "Maintenance"},
{"type": "docs", "section": "Maintenance"},
{"type": "revert", "section": "Bug Fixes"},
{"type": "revert", "section": "Fixes"},
{"type": "style", "hidden": true},
{"type": "refactor", "hidden": true},
{"type": "perf", "hidden": true},
Expand All @@ -42,8 +47,12 @@
["@semantic-release/changelog", {
"changelogFile": "./CHANGELOG.md"
}],
["@semantic-release/exec", {
"prepareCmd": "mvn versions:set -DnewVersion=${nextRelease.version} \
-DautoVersionSubmodules=true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the version in the README is still hardcoded. I am concerned we will automate this but then forget about the version in the README. How will this be addressed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be honest I forgot that we also need to update the README.md, so thank you!
To answer to your question I'm pretty sure I can do something like this as part of the prepareCmd
find README.md -type f -exec sed -i "" 's/<version>.*<\/version>/<version>${nextRelease.version}<\/version>' {} \; but I would have to test to make sure I can add more than 1 command, I think I can though.

}]
["@semantic-release/git", {
"assets": ["./CHANGELOG.md"],
"assets": ["./CHANGELOG.md", "./pom.xml"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
Expand Down