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

Commit

Permalink
Update version and publish to sonatype instead of bintray
Browse files Browse the repository at this point in the history
  • Loading branch information
Stav Shamir authored and Stav Shamir committed Sep 27, 2021
1 parent 2c27e25 commit f7b7643
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ testem.log
# System Files
.DS_Store
Thumbs.db
/gradle.properties
63 changes: 43 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id 'java'
id 'com.github.node-gradle.node' version '2.2.4'
id 'signing'
id 'maven-publish'
id 'com.jfrog.bintray' version '1.8.5'
}

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

node {
Expand Down Expand Up @@ -38,6 +38,9 @@ artifacts {
archives sourcesJar
}

signing {
sign configurations.archives
}

def pomConfig = {
licenses {
Expand All @@ -62,7 +65,7 @@ def pomConfig = {

publishing {
publications {
mavenPublication(MavenPublication) {
mavenJava(MavenPublication) {
artifact jar

artifact sourcesJar {
Expand All @@ -78,26 +81,46 @@ publishing {
root.appendNode('name', 'springwolf-ui')
root.appendNode('url', 'https://github.com/springwolf/springwolf-ui')
root.children().last() + pomConfig

def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}

project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
}
}
}

bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
publications = ['mavenPublication']

pkg {
repo = 'springwolf'
name = 'springwolf-ui'
userOrg = 'stavshamir'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/springwolf/springwolf-ui.git'
version {
name = project.version
desc = 'Web UI for Springwolf'
released = new Date()
repositories {
maven {
url 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}

model {
tasks.publishMavenJavaPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToMavenRepository {
dependsOn project.tasks.signArchives
}
}
}

0 comments on commit f7b7643

Please sign in to comment.