Skip to content

Commit

Permalink
Fix maven publish
Browse files Browse the repository at this point in the history
  • Loading branch information
FigT committed May 21, 2024
1 parent 25bf132 commit 3f0d7d2
Showing 1 changed file with 41 additions and 38 deletions.
79 changes: 41 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ allprojects {
group('gg.saki')
}


subprojects {
apply(plugin: 'java-library')
apply(plugin: 'org.cadixdev.licenser')
Expand Down Expand Up @@ -45,59 +46,61 @@ subprojects {
}
}

boolean isReleaseVersion = !this.version.toString().endsWith("SNAPSHOT")

publishing {
repositories {
maven {
name = 'saki'
url = isReleaseVersion ? 'https://repo.saki.gg/releases' : 'https://repo.saki.gg/snapshots'
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
boolean isReleaseVersion = !version.toString().endsWith("SNAPSHOT")

afterEvaluate {
publishing {
repositories {
maven {
name = 'saki'
url = isReleaseVersion ? 'https://repo.saki.gg/releases' : 'https://repo.saki.gg/snapshots'
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}

publications {
main(MavenPublication) {
from components.java
publications {
main(MavenPublication) {
from components.java

pom {
groupId = this.project.group
artifactId = this.project.archivesBaseName
version = this.project.version
pom {
groupId = project.group
artifactId = project.archivesBaseName
version = project.version

name = this.project.archivesBaseName
description = this.project.description
url = 'https://github.com/SakiPowered/zaiko'
name = project.archivesBaseName
description = project.description
url = 'https://github.com/SakiPowered/zaiko'

licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
}

scm {
connection = 'scm:git:git://github.com/SakiPowered/zaiko.git'
developerConnection = 'scm:git:ssh://github.com/SakiPowered/zaiko.git'
url = 'https://github.com/SakiPowered/zaiko'
scm {
connection = 'scm:git:git://github.com/SakiPowered/zaiko.git'
developerConnection = 'scm:git:ssh://github.com/SakiPowered/zaiko.git'
url = 'https://github.com/SakiPowered/zaiko'
}
}
}
}
}
}

signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }

String signingKeyId = findProperty("signingKeyId")
String signingKey = findProperty("signingKey")
String signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
String signingKeyId = findProperty("signingKeyId")
String signingKey = findProperty("signingKey")
String signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)

sign publishing.publications.main
sign publishing.publications.main
}
}
}

Expand Down

0 comments on commit 3f0d7d2

Please sign in to comment.