-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathpublish.gradle
104 lines (92 loc) · 3.64 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
standardOutput = stdout
}
def branch=stdout.toString().trim();
if( ( (branch.equals("develop") || branch.equals("master") || branch.contains("release/") ) ) &&
( System.getenv("bamboo_JAR_SIGNING_KEYRING") != null) &&
( System.getenv("bamboo_JAR_SIGNING_PASSWORD")!=null ) &&
( System.getenv("bamboo_SONATYPE_USERNAME")!=null ) &&
( System.getenv("bamboo_SONATYPE_PASSWORD")!=null ) ) {
apply plugin: "signing"
apply plugin: "maven-publish"
ext {
snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots"
releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
localUrl = "file:/${project.projectDir}/artifacts"
}
ext."signing.keyId" = 'FDEB5A45'
ext."signing.secretKeyRingFile" = "$System.env.bamboo_JAR_SIGNING_KEYRING"
ext."signing.password" = "$System.env.bamboo_JAR_SIGNING_PASSWORD"
configurations {
pom
}
signing {
sign configurations.archives
}
signing {
sign configurations.pom
}
publishing {
repositories {
maven {
url snapshotUrl
credentials {
username = "$System.env.bamboo_SONATYPE_USERNAME"
password = "$System.env.bamboo_SONATYPE_PASSWORD"
}
}/*
maven {
url releaseUrl
credentials {
username = "$System.env.bamboo_SONATYPE_USERNAME"
password = "$System.env.bamboo_SONATYPE_PASSWORD"
}
}*/
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact ('README.md') {
classifier = 'README'
extension = 'md'
}
artifact javadocJar
artifact sourcesJar
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'fhe-core'
description 'Kryptnostic implementations of Fully Homomorphic Encryption'
url 'https://www.github.com/kryptnostic/fhe-core'
scm {
url 'https://www.github.com/kryptnostic/fhe-core'
connection 'https://www.github.com/kryptnostic/fhe-core'
developerConnection 'https://www.github.com/kryptnostic/fhe-core'
}
licenses {
license {
name 'Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License'
url 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode'
distribution 'repo'
}
}
developers {
developer {
id 'geekbeast'
name 'Matthew Tamayo-Rios'
email '[email protected]'
}
developer {
id 'nickdhewitt'
name 'Nick Hewitt'
email '[email protected]'
}
}
}
}
}
}
}
}