Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven central publishing and Bintray removal #52

Merged
merged 3 commits into from
Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 11 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
id 'signing'
id 'com.diffplug.spotless' version '6.11.0'
id "com.github.hierynomus.license-report" version "0.16.1"
id 'com.jfrog.bintray' version '1.8.5'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'net.ltgt.errorprone' version '3.0.1'
}
Expand Down Expand Up @@ -278,6 +277,17 @@ publishing {
}
}
}
if (System.getenv('MAVEN_CENTRAL_DEPLOY') == 'true') {
repositories {
maven {
credentials {
username = "$ossrhUsername"
password = "$ossrhPassword"
}
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
}
}
}

tasks.withType(Sign) {
Expand All @@ -290,42 +300,3 @@ model {
}
tasks.publishMavenDeploymentPublicationToMavenLocal { dependsOn project.tasks.signArchives }
}

def artifactIdMatcher = Pattern.compile("(.*)-\\d.*")
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publications = ['MavenDeployment']
filesSpec {
project.extensions.getByType(PublishingExtension).publications.all { publication ->
publication.getArtifacts().all {
def ascFile = new File(it.file.getParentFile(), it.file.getName() + '.asc')
if (ascFile.exists()) {
def matcher = artifactIdMatcher.matcher(it.file.getName())
matcher.find()
def artifactId = matcher.group(1)
from ascFile.getAbsolutePath()
into publication.groupId.replaceAll('\\.', '/') + '/' + artifactId + '/' + publication.version + '/'
}
}
}
}
dryRun = !(System.getenv('BINTRAY_DEPLOY') == 'true')
publish = true
pkg {
userOrg = 'tomlj'
repo = 'tomlj'
name = 'tomlj'
websiteUrl = 'https://github.com/tomlj/tomlj'
vcsUrl = 'https://github.com/tomlj/tomlj'
licenses = ['Apache-2.0']
version {
name = project.version
desc = 'A parser for Tom\'s Obvious, Minimal Language (TOML).'
released = new Date()
vcsTag = project.version
}
}
}

deploy.dependsOn bintrayUpload