diff --git a/.releaserc b/.releaserc index 6b0fa91ca..4228c5759 100644 --- a/.releaserc +++ b/.releaserc @@ -25,7 +25,8 @@ "@semantic-release/git", { "assets": [ - "gradle.properties" + "gradle.properties", + "charts/hedera-network-/Chart.yaml" ] } ] diff --git a/buildSrc/src/main/kotlin/Utils.kt b/buildSrc/src/main/kotlin/Utils.kt index c4a1fa466..9b77c9f16 100644 --- a/buildSrc/src/main/kotlin/Utils.kt +++ b/buildSrc/src/main/kotlin/Utils.kt @@ -28,9 +28,15 @@ class Utils { } @JvmStatic - fun updateCommitizenVersion(project: Project, newVersion: SemVer) { - val czFile = File(project.projectDir, ".cz.toml") - updateStringInFile(czFile, "version =", "version = \"${newVersion}\"") + fun updateHelmChartVersion(project: Project, chartName: String, newVersion: SemVer) { + val manifestFile = File(project.rootProject.projectDir, "charts/${chartName}/Chart.yaml") + updateStringInFile(manifestFile, "version:", "version: $newVersion") + } + + @JvmStatic + fun updateHelmChartAppVersion(project: Project, chartName: String, newVersion: SemVer) { + val manifestFile = File(project.rootProject.projectDir, "charts/${chartName}/Chart.yaml") + updateStringInFile(manifestFile, "appVersion:", "appVersion: \"${newVersion}\"") } private fun updateStringInFile(file: File, startsWith: String, newString: String) { diff --git a/buildSrc/src/main/kotlin/com.hedera.fullstack.aggregate-reports.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.fullstack.aggregate-reports.gradle.kts index 1bfdd0ec3..d87ef35a2 100644 --- a/buildSrc/src/main/kotlin/com.hedera.fullstack.aggregate-reports.gradle.kts +++ b/buildSrc/src/main/kotlin/com.hedera.fullstack.aggregate-reports.gradle.kts @@ -42,27 +42,25 @@ sonarqube { tasks.register("githubVersionSummary") { group = "versioning" doLast { - val ghStepSummaryPath: String? = System.getenv("GITHUB_STEP_SUMMARY") - if (ghStepSummaryPath == null) { - throw IllegalArgumentException("This task may only be run in a Github Actions CI environment! Unable to locate the GITHUB_STEP_SUMMARY environment variable.") - } + val ghStepSummaryPath: String = System.getenv("GITHUB_STEP_SUMMARY") + ?: throw IllegalArgumentException("This task may only be run in a Github Actions CI environment! Unable to locate the GITHUB_STEP_SUMMARY environment variable.") val ghStepSummaryFile: File = File(ghStepSummaryPath) Utils.generateProjectVersionReport(rootProject, BufferedOutputStream(ghStepSummaryFile.outputStream())) } } +val HEDERA_NETWORK_CHART = "hedera-network" + tasks.register("versionAsSpecified") { group = "versioning" doLast { val verStr = findProperty("newVersion")?.toString() - - if (verStr == null) { - throw IllegalArgumentException("No newVersion property provided! Please add the parameter -PnewVersion= when running this task.") - } + ?: throw IllegalArgumentException("No newVersion property provided! Please add the parameter -PnewVersion= when running this task.") val newVer = SemVer.parse(verStr) - Utils.updateCommitizenVersion(project, newVer) + Utils.updateHelmChartVersion(project, HEDERA_NETWORK_CHART, newVer) + Utils.updateHelmChartAppVersion(project, HEDERA_NETWORK_CHART, newVer) Utils.updateVersion(project, newVer) } } @@ -73,7 +71,8 @@ tasks.register("versionAsSnapshot") { val currVer = SemVer.parse(project.version.toString()) val newVer = SemVer(currVer.major, currVer.minor, currVer.patch, "SNAPSHOT") - Utils.updateCommitizenVersion(project, newVer) + Utils.updateHelmChartVersion(project, HEDERA_NETWORK_CHART, newVer) + Utils.updateHelmChartAppVersion(project, HEDERA_NETWORK_CHART, newVer) Utils.updateVersion(project, newVer) } }