Skip to content
This repository was archived by the owner on Jun 18, 2023. It is now read-only.

Commit f7b7643

Browse files
Stav ShamirStav Shamir
authored andcommitted
Update version and publish to sonatype instead of bintray
1 parent 2c27e25 commit f7b7643

File tree

2 files changed

+44
-20
lines changed

2 files changed

+44
-20
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ testem.log
4646
# System Files
4747
.DS_Store
4848
Thumbs.db
49+
/gradle.properties

build.gradle

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
plugins {
22
id 'java'
33
id 'com.github.node-gradle.node' version '2.2.4'
4+
id 'signing'
45
id 'maven-publish'
5-
id 'com.jfrog.bintray' version '1.8.5'
66
}
77

8-
group = 'io.github.stavshamir'
9-
version = '0.0.2'
8+
group = 'io.github.springwolf'
9+
version = '0.1.1' + (Boolean.valueOf(System.getProperty('snapshot')) ? '-SNAPSHOT' : '')
1010
sourceCompatibility = '1.8'
1111

1212
node {
@@ -38,6 +38,9 @@ artifacts {
3838
archives sourcesJar
3939
}
4040

41+
signing {
42+
sign configurations.archives
43+
}
4144

4245
def pomConfig = {
4346
licenses {
@@ -62,7 +65,7 @@ def pomConfig = {
6265

6366
publishing {
6467
publications {
65-
mavenPublication(MavenPublication) {
68+
mavenJava(MavenPublication) {
6669
artifact jar
6770

6871
artifact sourcesJar {
@@ -78,26 +81,46 @@ publishing {
7881
root.appendNode('name', 'springwolf-ui')
7982
root.appendNode('url', 'https://github.com/springwolf/springwolf-ui')
8083
root.children().last() + pomConfig
84+
85+
def pomFile = file("${project.buildDir}/generated-pom.xml")
86+
writeTo(pomFile)
87+
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
88+
artifact(pomAscFile) {
89+
classifier = null
90+
extension = 'pom.asc'
91+
}
92+
}
93+
94+
project.tasks.signArchives.signatureFiles.each {
95+
artifact(it) {
96+
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
97+
if (matcher.find()) {
98+
classifier = matcher.group(1)
99+
} else {
100+
classifier = null
101+
}
102+
extension = 'jar.asc'
103+
}
81104
}
82105
}
83106
}
84-
}
85107

86-
bintray {
87-
user = System.getProperty('bintray.user')
88-
key = System.getProperty('bintray.key')
89-
publications = ['mavenPublication']
90-
91-
pkg {
92-
repo = 'springwolf'
93-
name = 'springwolf-ui'
94-
userOrg = 'stavshamir'
95-
licenses = ['Apache-2.0']
96-
vcsUrl = 'https://github.com/springwolf/springwolf-ui.git'
97-
version {
98-
name = project.version
99-
desc = 'Web UI for Springwolf'
100-
released = new Date()
108+
repositories {
109+
maven {
110+
url 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
111+
credentials {
112+
username = ossrhUsername
113+
password = ossrhPassword
114+
}
115+
}
116+
}
117+
118+
model {
119+
tasks.publishMavenJavaPublicationToMavenLocal {
120+
dependsOn project.tasks.signArchives
121+
}
122+
tasks.publishMavenJavaPublicationToMavenRepository {
123+
dependsOn project.tasks.signArchives
101124
}
102125
}
103126
}

0 commit comments

Comments
 (0)