@@ -7,7 +7,7 @@ plugins {
77}
88
99group = " net.azisaba.serialization"
10- version = " 1 .0-SNAPSHOT"
10+ version = System .getenv( " VERSION " ) ? : " 0.0 .0-SNAPSHOT"
1111
1212val kotlinx = libs.kotlinx
1313
@@ -16,6 +16,7 @@ configure(subprojects.filter { it.childProjects.isEmpty() }) {
1616 version = rootProject.version
1717
1818 apply (plugin = " java-library" )
19+ apply (plugin = " maven-publish" )
1920 apply (plugin = " org.jetbrains.kotlin.jvm" )
2021
2122 repositories {
@@ -34,4 +35,29 @@ configure(subprojects.filter { it.childProjects.isEmpty() }) {
3435 configure<JavaPluginExtension > {
3536 toolchain.languageVersion.set(JavaLanguageVersion .of(11 ))
3637 }
38+
39+ configure<PublishingExtension > {
40+ publications {
41+ create<MavenPublication >(" mavenJava" ) {
42+ from(components[" java" ])
43+ groupId = group.toString()
44+ artifactId = project.name
45+ version = version.toString()
46+ }
47+ }
48+ repositories {
49+ maven {
50+ name = " azisaba"
51+ url = if (version.toString().contains(" SNAPSHOT" )) {
52+ uri(" https://repo.azisaba.net/repository/maven-snapshots/" )
53+ } else {
54+ uri(" https://repo.azisaba.net/repository/maven-releases/" )
55+ }
56+ credentials {
57+ username = System .getenv(" REPO_USERNAME" )
58+ password = System .getenv(" REPO_PASSWORD" )
59+ }
60+ }
61+ }
62+ }
3763}
0 commit comments