-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.gradle
32 lines (30 loc) · 1.22 KB
/
publish.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
ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.key"] = ''
ext["ossrhTokenUsername"] = ''
ext["ossrhTokenPassword"] = ''
ext["sonatypeStagingProfileId"] = ''
File localProperties = project.rootProject.file('local.properties')
if (localProperties.exists()) {
Properties p = new Properties()
new FileInputStream(localProperties).withCloseable { is -> p.load(is) }
p.each { name, value -> ext[name] = value }
} else {
ext["ossrhTokenUsername"] = System.getenv('OSSRH_TOKEN_USERNAME')
ext["ossrhTokenPassword"] = System.getenv('OSSRH_TOKEN_PASSWORD')
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.key"] = System.getenv('SIGNING_KEY')
}
nexusPublishing {
repositories {
sonatype {
stagingProfileId = sonatypeStagingProfileId
username = ossrhTokenUsername
password = ossrhTokenPassword
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}