Skip to content

Commit

Permalink
Adding gradle task to bumpVersion on gradle.properties and Chart.yaml
Browse files Browse the repository at this point in the history
Also improvements to the WF to be able to bump the version.

Signed-off-by: Alfredo Gutierrez <[email protected]>
  • Loading branch information
AlfredoG87 committed Aug 8, 2024
1 parent 2fd1bdb commit 9c1e726
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/release-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ jobs:
git checkout ${RELEASE_BRANCH}
fi
- name: Gradle Release
run: ./gradlew release -Pversion=${{ env.VERSION }}
# task is currently failing due to needing credentials.username for PublishToMavenRepository task
#- name: Gradle Release
# run: ./gradlew release -Pversion=${{ env.VERSION }}

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

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

- name: Create Pull Request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
Expand Down
2 changes: 1 addition & 1 deletion charts/hedera-block-node/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: "0.1.0-SNAPSHOT"
appVersion: 0.1.0-SNAPSHOT
description: A Helm chart for Hedera Block Node
home: https://github.com/hashgraph/hedera-block-node
keywords:
Expand Down
29 changes: 29 additions & 0 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,35 @@ testModuleInfo {
requiresStatic("com.github.spotbugs.annotations")
}

// Release related tasks

fun replaceVersion(files: String, match: String) {
ant.withGroovyBuilder {
"replaceregexp"(
"match" to match,
"replace" to project.version,
"flags" to "gm"
) {
"fileset"(
"dir" to rootProject.projectDir,
"includes" to files,
"excludes" to "**/node_modules/"
)
}
}
}

tasks.register("bumpVersion") {
description = "Bump versions of the project"
group = "release"

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


// Docker related tasks

var updateDockerEnv =
tasks.register<Exec>("updateDockerEnv") {
description =
Expand Down

0 comments on commit 9c1e726

Please sign in to comment.