Skip to content

Commit

Permalink
fixes to bumpVersion task, so it needs newVersion parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Gutierrez <[email protected]>
  • Loading branch information
AlfredoG87 committed Jan 14, 2025
1 parent 543ee3e commit 8748ec8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
# run: ./gradlew release -Pversion=${{ env.VERSION }}

- name: Bump Version
run: ./gradlew bumpVersion -Pversion=${{ env.VERSION }}
run: ./gradlew bumpVersion -PnewVersion=${{ env.VERSION }}

- name: Close the Milestone
if: ${{ steps.version_parser.outputs.prerelease == '' }}
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
git reset --hard $RELEASE_BRANCH
- name: Gradle Release for Next Minor Snapshot
run: ./gradlew bumpVersion -Pversion=${{ env.NEXT_VERSION_SNAPSHOT }}
run: ./gradlew bumpVersion -PnewVersion=${{ env.NEXT_VERSION_SNAPSHOT }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
Expand Down
11 changes: 7 additions & 4 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ testModuleInfo {

// Release related tasks

fun replaceVersion(files: String, match: String) {
fun replaceVersion(files: String, match: String, newVersion: String) {
ant.withGroovyBuilder {
"replaceregexp"("match" to match, "replace" to project.version, "flags" to "gm") {
"replaceregexp"("match" to match, "replace" to newVersion, "flags" to "gm") {
"fileset"(
"dir" to rootProject.projectDir,
"includes" to files,
Expand All @@ -52,8 +52,11 @@ tasks.register("bumpVersion") {
description = "Bump versions of the project"
group = "release"

replaceVersion("charts/**/Chart.yaml", "(?<=^(appVersion|version): ).+")
replaceVersion("gradle.properties", "(?<=^version=).+")
val newVersion = project.findProperty("newVersion") as String? ?: throw GradleException("Please provide -PnewVersion=<version>")


replaceVersion("charts/**/Chart.yaml", "(?<=^(appVersion|version): ).+", newVersion)
replaceVersion("version.txt", ".+", newVersion)
}

// Vals
Expand Down

0 comments on commit 8748ec8

Please sign in to comment.