-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpublication.gradle
78 lines (69 loc) · 2.52 KB
/
publication.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
apply plugin: 'maven-publish'
apply plugin: 'signing'
def prepareEnvironment() {
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.key"] = System.getenv('SIGNING_KEY')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
}
def static getVersionFromGitTag() {
return 'git describe --abbrev=0 --tags'.execute().text.trim()
}
publishing {
prepareEnvironment()
repositories {
maven {
name = 'mavenCentral'
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = findProperty("ossrhUsername") ?: ""
password = findProperty("ossrhPassword") ?: ""
}
}
}
afterEvaluate {
publications {
release(MavenPublication) {
from components.release
pom {
group = 'com.parsely'
name = 'parsely'
version = getVersionFromGitTag()
description = 'The official Parse.ly Android toolkit'
url = 'https://github.com/Parsely/parsely-android'
licenses {
license {
name = 'Apache-2.0'
url = 'https://github.com/Parsely/parsely-android/blob/master/COPYING'
}
}
scm {
connection = 'scm:git:github.com/Parsely/parsely-android.git'
developerConnection = 'scm:git:ssh://github.com/Parsely/parsely-android.git'
url = 'https://github.com/Parsely/parsely-android/tree/main'
}
developers {
developer {
id = 'wzieba'
name = 'Wojtek Zieba'
email = '[email protected]'
}
}
organization {
name = 'Parse.ly'
url = 'https://www.parse.ly/'
}
}
}
}
}
}
signing {
useInMemoryPgpKeys(
findProperty("signing.keyId") ?: "",
findProperty("signing.key") ?: "",
findProperty("signing.password") ?: "",
)
sign publishing.publications
}