-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: replace 'bumpVersion' with extended 'versionAsSpecified'
This uses as much as possible of the functionality already provided through 'hiero-gradle-conventions' See: - https://github.com/hiero-ledger/hiero-gradle-conventions/tree/main?tab=readme-ov-file#publishing - https://github.com/hiero-ledger/hiero-gradle-conventions/blob/main/src/main/kotlin/org.hiero.gradle.feature.versioning.gradle.kts#L88-L102 Signed-off-by: Jendrik Johannes <[email protected]>
- Loading branch information
Showing
3 changed files
with
20 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import net.swiftzer.semver.SemVer | ||
|
||
tasks.versionAsSpecified { | ||
val chartFile = | ||
fileTree(rootDir) { | ||
include("charts/**/Chart.yaml") | ||
exclude("**/node_modules/") | ||
} | ||
doLast { | ||
val newVersion = SemVer.parse(inputs.properties["newVersion"] as String).toString() | ||
chartFile.forEach { file -> | ||
val yaml = file.readText() | ||
val oldVersion = Regex("(?<=^(appVersion|version): ).+", RegexOption.MULTILINE) | ||
file.writeText(yaml.replace(oldVersion, newVersion)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters