Skip to content

Commit e37d4e9

Browse files
committed
chore: fix using gradle project version in github releases
1 parent 98c74fe commit e37d4e9

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565

6666
- name: Get project version
6767
id: get_version
68-
run: echo "PROJECT_VERSION=$(./gradlew properties -q -Pprop=version)" >> $GITHUB_ENV
68+
run: echo "PROJECT_VERSION=$(./gradlew -q printVersion)" >> $GITHUB_ENV
6969

7070
- name: Generate tag name
7171
id: generate_tag # id is not strictly needed here as we are using GITHUB_ENV but good practice

build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,15 @@ tasks.register<Jar>("bwextension") {
8989
tasks.named("build") {
9090
dependsOn("bwextension")
9191
}
92+
93+
// Task to print just the version for CI/CD
94+
tasks.register("printVersion") {
95+
group = "help"
96+
description = "Prints the project version"
97+
doLast {
98+
// Use System.out.print to avoid extra newlines
99+
print(project.version)
100+
}
101+
// Ensure this task doesn't show progress
102+
logging.captureStandardOutput(LogLevel.QUIET)
103+
}

0 commit comments

Comments
 (0)