Fix behavior to match tags with no prefix

This commit is contained in:
Jodie Weldon 2025-11-28 15:33:50 -08:00
parent f3481de7a0
commit 43f73aafdc
4 changed files with 9 additions and 8 deletions

View File

@ -114,6 +114,7 @@ intellijPlatform {
changelog { changelog {
groups.empty() groups.empty()
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl") repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
versionPrefix = ""
} }
// Configure Gradle Kover Plugin - read more: https://kotlin.github.io/kotlinx-kover/gradle-plugin/#configuration-details // Configure Gradle Kover Plugin - read more: https://kotlin.github.io/kotlinx-kover/gradle-plugin/#configuration-details

View File

@ -240,7 +240,7 @@ jobs:
RELEASE_NOTE="./build/tmp/release_note.txt" RELEASE_NOTE="./build/tmp/release_note.txt"
./gradlew getChangelog --unreleased --no-header --quiet --console=plain --output-file=$RELEASE_NOTE ./gradlew getChangelog --unreleased --no-header --quiet --console=plain --output-file=$RELEASE_NOTE
gh release create v$VERSION \ gh release create $VERSION \
--draft \ --draft \
--title $VERSION \ --title $VERSION \
--notes-file $RELEASE_NOTE --notes-file $RELEASE_NOTE

View File

@ -6,12 +6,11 @@
### Added ### Added
- GitHub Actions: template `build.gradle.kts` without the Changelog `sectionUrlBuilder` for tag prefix handling - GitHub Actions: template `build.gradle.kts` with `versionPrefix` to set default tag prefix
### Fixed ### Fixed
- GitHub Actions - release tag version missing "v" prefix when created - Add `sectionUrlBuilder` Changelog property to `build.gradle.kts` so comparison links in `CHANGELOG.md` will use correct tag prefix
- Gradle - comparison links in CHANGELOG.md using "v" prefix for tags that don't have it
## [2.4.0] - 2025-11-25 ## [2.4.0] - 2025-11-25

View File

@ -116,14 +116,15 @@ changelog {
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl") repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
// Handle some of GitHub release tags missing the default "v" prefix // Handle some of GitHub release tags missing the default "v" prefix
sectionUrlBuilder = ChangelogSectionUrlBuilder { repositoryUrl, currentVersion, previousVersion, isUnreleased -> sectionUrlBuilder = ChangelogSectionUrlBuilder { repositoryUrl, currentVersion, previousVersion, isUnreleased ->
val vVersions = listOf("2.2.0", "2.1.0", "2.0.2", "2.0.1", "2.0.0", "1.14.2", "1.14.1", "1.14.0", "1.13.0", "1.12.0", "1.11.3", "1.11.2", "1.11.1", "1.11.0", "1.10.0", "1.9.0", "1.8.0", "1.7.0", "1.6.0", "1.5.0", "1.4.0", "1.3.0", "1.2.0", "1.1.2", "1.1.1", "1.1.0", "1.0.0", "0.10.1", "0.10.0", "0.9.0", "0.8.3", "0.8.2", "0.8.1", "0.8.0", "0.7.1", "0.7.0", "0.6.1", "0.6.0", "0.5.1", "0.5.0", "0.4.0", "0.3.2", "0.3.1", "0.3.0", "0.2.0", "0.1.0", "0.0.2", "0.0.1")
val prefix: (String?) -> String = { version -> when (version) { val prefix: (String?) -> String = { version -> when (version) {
"2.3.0" -> "" in vVersions -> "v"
"2.3.1" -> "" else -> ""
"2.4.0" -> ""
else -> "v"
} } } }
val previousPrefix = prefix(previousVersion) val previousPrefix = prefix(previousVersion)
val currentPrefix = prefix(currentVersion) val currentPrefix = prefix(currentVersion)
repositoryUrl + when { repositoryUrl + when {
isUnreleased -> when (previousVersion) { isUnreleased -> when (previousVersion) {
null -> "/commits" null -> "/commits"