-
Notifications
You must be signed in to change notification settings - Fork 4
/
publish.gradle
67 lines (64 loc) · 2.57 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
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
def SONATYPE_USERNAME = System.getenv('SONATYPE_USERNAME')
def SONATYPE_PASSWORD = System.getenv('SONATYPE_PASSWORD')
def BUILD_NUMBER = System.getenv('CIRCLE_BUILD_NUM')
def signinKeyID = System.getenv('SIGNING_KEYID')
def signinPassword = System.getenv('SIGNING_PASSWORD')
def signingSecretKeyRingFile = {
def f = File.createTempFile(UUID.randomUUID().toString(), null);
FileOutputStream fos = new FileOutputStream(f)
fos.write(Base64.decoder.decode(System.getenv('SIGNING_SECRETKEYRINGFILE')))
return f.absolutePath
}
task sonaTypeUpload(type: Upload) {
if (SONATYPE_USERNAME == null || BUILD_NUMBER == null) {
return
}
configuration = configurations.archives
uploadDescriptor = true
repositories {
allprojects {
ext."signing.keyId" = signinKeyID
ext."signing.secretKeyRingFile" = signingSecretKeyRingFile()
ext."signing.password" = signinPassword
}
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: SONATYPE_USERNAME, password: SONATYPE_PASSWORD)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
authentication(userName: SONATYPE_USERNAME, password: SONATYPE_PASSWORD)
}
pom.project {
name name
description description
packaging 'jar'
inceptionYear '2019'
url "https://github.com/hasanozgan/komandante"
organization {
name 'netology'
url 'http://netology.org'
}
developers {
developer {
id 'hasanozgan'
name 'Hasan Ozgan'
email '[email protected]'
url 'https://hasanozgan.com'
}
}
scm {
connection 'scm:git:https://github.com/hasanozgan/komandante.git'
developerConnection 'scm:git:https://github.com/hasanozgan/komandante.git'
url 'https://github.com/hasanozgan/komandante'
}
licenses {
license {
name 'The MIT License'
url 'https://opensource.org/licenses/MIT'
}
}
}
}
}
}