dropped usage of bintray, jcenter and jfrog artifactory

deploy to Sonatype OSSRH

snapshots are now here:
https://oss.sonatype.org/content/repositories/snapshots/com/formdev/
This commit is contained in:
Karl Tauber
2021-02-06 19:02:32 +01:00
parent dd1eacf4f0
commit 823d4b0fe2
7 changed files with 44 additions and 111 deletions

View File

@@ -99,11 +99,11 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
- name: Publish snapshot to oss.jfrog.org
run: ./gradlew artifactoryPublish
- name: Publish snapshot to oss.sonatype.org
run: ./gradlew publish -Dorg.gradle.internal.publish.checksums.insecure=true
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
release:
@@ -135,8 +135,10 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
- name: Release a new stable version to bintray
run: ./gradlew bintrayUpload -Drelease=true
- name: Release a new stable version to Maven Central
run: ./gradlew publish -Drelease=true
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

View File

@@ -53,11 +53,11 @@ Otherwise download `flatlaf-<version>.jar` here:
### Snapshots
FlatLaf snapshot binaries are available in
[JFrog Artifactory](https://oss.jfrog.org/artifactory/oss-snapshot-local/com/formdev/).
To access the latest snapshot, change the FlatLaf version(s) in the dependencies
FlatLaf snapshot binaries are available on
[Sonatype OSSRH](https://oss.sonatype.org/content/repositories/snapshots/com/formdev/flatlaf/).
To access the latest snapshot, change the FlatLaf version in your dependencies
to `<version>-SNAPSHOT` (e.g. `0.27-SNAPSHOT`) and add the repository
`https://oss.jfrog.org/artifactory/oss-snapshot-local` to your build (see
`https://oss.sonatype.org/content/repositories/snapshots/` to your build (see
[Maven](https://maven.apache.org/guides/mini/guide-multiple-repositories.html)
and
[Gradle](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:declaring_custom_repository)

View File

@@ -23,7 +23,7 @@ allprojects {
version = rootProject.version
repositories {
jcenter()
mavenCentral()
}
}
@@ -40,17 +40,6 @@ println( "Java ${System.getProperty( "java.version" )}" )
println()
extra["bintray.user"] = System.getenv( "BINTRAY_USER" ) ?: System.getProperty( "bintray.user" )
extra["bintray.key"] = System.getenv( "BINTRAY_KEY" ) ?: System.getProperty( "bintray.key" )
// if true, do not upload to bintray
extra["bintray.dryRun"] = false
// if true, uploaded artifacts are visible to all
// if false, only visible to owner when logged into bintray
extra["bintray.publish"] = false
allprojects {
tasks {
withType<JavaCompile>().configureEach {

View File

@@ -20,15 +20,5 @@ plugins {
// required for kotlin-dsl or embedded-kotlin plugins
repositories {
jcenter()
}
dependencies {
// NOTE: keep plugin versions in sync with settings.gradle.kts
// "com.jfrog.bintray" plugin
implementation( "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4" )
// "com.jfrog.artifactory" plugin
implementation( "org.jfrog.buildinfo:build-info-extractor-gradle:4.13.0" )
mavenCentral()
}

View File

@@ -26,8 +26,7 @@ val extension = project.extensions.create<PublishExtension>( "flatlafPublish" )
plugins {
`maven-publish`
id( "com.jfrog.bintray" )
id( "com.jfrog.artifactory" )
signing
}
publishing {
@@ -74,49 +73,40 @@ publishing {
}
}
}
}
bintray {
user = rootProject.extra["bintray.user"] as String?
key = rootProject.extra["bintray.key"] as String?
repositories {
maven {
name = "OSSRH"
setPublications( "maven" )
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = uri( if( java.lang.Boolean.getBoolean( "release" ) ) releasesRepoUrl else snapshotsRepoUrl )
with( pkg ) {
repo = "flatlaf"
afterEvaluate {
this@with.name = extension.artifactId
credentials {
// get from gradle.properties
val ossrhUsername: String? by project
val ossrhPassword: String? by project
username = System.getenv( "OSSRH_USERNAME" ) ?: ossrhUsername
password = System.getenv( "OSSRH_PASSWORD" ) ?: ossrhPassword
}
setLicenses( "Apache-2.0" )
vcsUrl = "https://github.com/JFormDesigner/FlatLaf"
with( version ) {
name = project.version.toString()
}
publish = rootProject.extra["bintray.publish"] as Boolean
dryRun = rootProject.extra["bintray.dryRun"] as Boolean
}
}
artifactory {
setContextUrl( "https://oss.jfrog.org" )
signing {
// get from gradle.properties
val signingKey: String? by project
val signingPassword: String? by project
publish( closureOf<org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig> {
repository( delegateClosureOf<groovy.lang.GroovyObject> {
setProperty( "repoKey", "oss-snapshot-local" )
setProperty( "username", rootProject.extra["bintray.user"] as String? )
setProperty( "password", rootProject.extra["bintray.key"] as String? )
} )
val key = System.getenv( "SIGNING_KEY" ) ?: signingKey
val password = System.getenv( "SIGNING_PASSWORD" ) ?: signingPassword
defaults( delegateClosureOf<groovy.lang.GroovyObject> {
invokeMethod( "publications", "maven" )
setProperty( "publishArtifacts", true )
setProperty( "publishPom", true )
} )
} )
resolve( delegateClosureOf<org.jfrog.gradle.plugin.artifactory.dsl.ResolverConfig> {
setProperty( "repoKey", "jcenter" )
} )
useInMemoryPgpKeys( key, password )
sign( publishing.publications["maven"] )
}
// disable signing of snapshots
tasks.withType<Sign>().configureEach {
onlyIf { java.lang.Boolean.getBoolean( "release" ) }
}

View File

@@ -16,15 +16,6 @@
plugins {
`java-library`
id( "com.jfrog.bintray" )
// Although artifactory plugin is not used in this subproject, the plugin is required
// because otherwise gradle fails with following error:
// Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException:
// Cannot cast object 'task ':bintrayUpload''
// with class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask_Decorated'
// to class 'com.jfrog.bintray.gradle.tasks.BintrayUploadTask'
id( "com.jfrog.artifactory" )
}
repositories {
@@ -68,24 +59,3 @@ tasks {
} )
}
}
bintray {
user = rootProject.extra["bintray.user"] as String?
key = rootProject.extra["bintray.key"] as String?
setConfigurations( "archives" )
with( pkg ) {
repo = "flatlaf"
name = "flatlaf-demo"
setLicenses( "Apache-2.0" )
vcsUrl = "https://github.com/JFormDesigner/FlatLaf"
with( version ) {
name = project.version.toString()
}
publish = rootProject.extra["bintray.publish"] as Boolean
dryRun = rootProject.extra["bintray.dryRun"] as Boolean
}
}

View File

@@ -24,11 +24,3 @@ include( "flatlaf-intellij-themes" )
include( "flatlaf-demo" )
include( "flatlaf-testing" )
include( "flatlaf-theme-editor" )
pluginManagement {
plugins {
// NOTE: keep plugin versions in sync with buildSrc/build.gradle.kts
id( "com.jfrog.bintray" ) version "1.8.4"
id( "com.jfrog.artifactory" ) version "4.13.0"
}
}