forked from lavalink-devs/Lavalink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repositories.gradle
43 lines (38 loc) · 1.73 KB
/
repositories.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Usage: apply from: 'repositories.gradle'
publishing {
boolean isOssrhDefined = findProperty("signing.gnupg.keyName") != null && findProperty("ossrhPassword") != null && findProperty("ossrhUsername") != null
boolean isMavenDefined = findProperty('MAVEN_USERNAME') != null && findProperty("MAVEN_PASSWORD") != null
if (!project.name.equals("Lavalink-Server")) {
if (isOssrhDefined) {
repositories {
def snapshots = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
def releases = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
maven {
url = version.endsWith("SNAPSHOT") ? snapshots : releases
credentials {
password = findProperty("ossrhPassword")
username = findProperty("ossrhUsername")
}
}
}
} else {
println("Not capable of publishing to OSSRH because of missing GPG key or OSSRH credentials")
}
}
if (findProperty("MAVEN_USERNAME") != null && findProperty("MAVEN_PASSWORD") != null) {
println("Publishing to Maven Repo")
repositories {
def snapshots = "https://maven.arbjerg.dev/snapshots"
def releases = "https://maven.arbjerg.dev/releases"
maven {
url = version.endsWith("SNAPSHOT") ? snapshots : releases
credentials {
password = findProperty("MAVEN_PASSWORD")
username = findProperty("MAVEN_USERNAME")
}
}
}
} else {
println("Maven credentials not found, not publishing to Maven Repo")
}
}