Skip to content

Commit ab7dad6

Browse files
committed
fix maven publish error
1 parent e90ad1d commit ab7dad6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
buildscript {
2020
ext.kotlin_version = '1.9.10'
2121

22-
ext.version_name = System.getenv('GITHUB_TAG')
23-
if (version_name == null || version_name.isEmpty()) {
24-
ext.version_name = version
22+
// Set version from GITHUB_TAG env var, or fall back to gradle.properties version
23+
def githubTag = System.getenv('GITHUB_TAG')
24+
if (githubTag != null && !githubTag.isEmpty()) {
25+
version = githubTag
2526
}
26-
ext.is_release_version = !version_name.endsWith("SNAPSHOT")
27+
ext.version_name = version // Keep version_name for BuildConfig compatibility
28+
ext.is_release_version = !version.endsWith("SNAPSHOT")
2729

2830
repositories {
2931
google()
@@ -276,7 +278,7 @@ configure(publishedProjects) {
276278
publishing {
277279
publications {
278280
release(MavenPublication) {
279-
version = version_name
281+
version = project.version
280282
group = group_id
281283
artifactId = artifactName
282284

0 commit comments

Comments
 (0)