Skip to content

Commit 5575854

Browse files
committed
1 parent 640f2ba commit 5575854

File tree

8 files changed

+50
-24
lines changed

8 files changed

+50
-24
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ jobs:
105105
distribution: temurin # pre-installed on ubuntu-latest
106106
cache: gradle
107107

108-
- name: Publish snapshot to oss.sonatype.org
108+
- name: Publish snapshot to Sonatype Central
109109
run: ./gradlew publish -PskipFonts -Dorg.gradle.internal.publish.checksums.insecure=true -Dorg.gradle.parallel=false
110110
env:
111-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
112-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
111+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
112+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
113113

114114

115115
release:
@@ -131,10 +131,10 @@ jobs:
131131
cache: gradle
132132

133133
- name: Release a new stable version to Maven Central
134-
run: ./gradlew publish :flatlaf-demo:build :flatlaf-theme-editor:build -PskipFonts -Prelease -Dorg.gradle.parallel=false
134+
run: ./gradlew publishToSonatype closeSonatypeStagingRepository :flatlaf-demo:build :flatlaf-theme-editor:build -PskipFonts -Prelease -Dorg.gradle.parallel=false
135135
env:
136-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
137-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
136+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
137+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
138138
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
139139
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
140140

.github/workflows/fonts.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ jobs:
4545
run: ./gradlew :flatlaf-fonts-${{ matrix.font }}:build
4646
if: startsWith( github.ref, format( 'refs/tags/fonts/{0}-', matrix.font ) ) != true
4747

48-
- name: Publish snapshot to oss.sonatype.org
48+
- name: Publish snapshot to Sonatype Central
4949
run: ./gradlew :flatlaf-fonts-${{ matrix.font }}:publish -Dorg.gradle.internal.publish.checksums.insecure=true
5050
env:
51-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
52-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
51+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
52+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
5353
if: github.ref == 'refs/heads/main' || startsWith( github.ref, 'refs/heads/develop-' )
5454

5555
- name: Release a new stable version to Maven Central
5656
run: ./gradlew :flatlaf-fonts-${{ matrix.font }}:build :flatlaf-fonts-${{ matrix.font }}:publish -Prelease
5757
env:
58-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
59-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
58+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
59+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
6060
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
6161
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
6262
if: startsWith( github.ref, format( 'refs/tags/fonts/{0}-', matrix.font ) )

.github/workflows/pr-snapshots.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
distribution: temurin # pre-installed on ubuntu-latest
2929
cache: gradle
3030

31-
- name: Publish PR snapshot to oss.sonatype.org
31+
- name: Publish PR snapshot to Sonatype Central
3232
run: >
3333
./gradlew publish -PskipFonts -Dorg.gradle.internal.publish.checksums.insecure=true -Dorg.gradle.parallel=false
3434
-Pgithub.event.pull_request.number=${{ github.event.pull_request.number }}
3535
env:
36-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
37-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
36+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
37+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ application.
8383
### Snapshots
8484

8585
FlatLaf snapshot binaries are available on
86-
[Sonatype OSSRH](https://oss.sonatype.org/content/repositories/snapshots/com/formdev/flatlaf/).
86+
[Sonatype Central](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/formdev/flatlaf/).
8787
To access the latest snapshot, change the FlatLaf version in your dependencies
88-
to `<version>-SNAPSHOT` (e.g. `0.27-SNAPSHOT`) and add the repository
89-
`https://oss.sonatype.org/content/repositories/snapshots/` to your build (see
88+
to `<version>-SNAPSHOT` (e.g. `3.7-SNAPSHOT`) and add the repository
89+
`https://central.sonatype.com/repository/maven-snapshots/` to your build (see
9090
[Maven](https://maven.apache.org/guides/mini/guide-multiple-repositories.html)
9191
and
9292
[Gradle](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:declaring_custom_repository)

build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import net.ltgt.gradle.errorprone.errorprone
1818

19+
group = "com.formdev"
1920
version = property( if( hasProperty( "release" ) ) "flatlaf.releaseVersion" else "flatlaf.developmentVersion" ) as String
2021

2122
// for PR snapshots change version to 'PR-<pr_number>-SNAPSHOT'
@@ -49,6 +50,7 @@ println()
4950

5051

5152
plugins {
53+
alias( libs.plugins.gradle.nexus.publish.plugin )
5254
alias( libs.plugins.errorprone ) apply false
5355
}
5456

@@ -143,3 +145,20 @@ allprojects {
143145
}
144146
}
145147
}
148+
149+
nexusPublishing {
150+
repositories {
151+
sonatype {
152+
// see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/
153+
nexusUrl = uri( "https://ossrh-staging-api.central.sonatype.com/service/local/" )
154+
snapshotRepositoryUrl = uri( "https://central.sonatype.com/repository/maven-snapshots/" )
155+
156+
// get from gradle.properties
157+
val sonatypeUsername: String? by project
158+
val sonatypePassword: String? by project
159+
160+
username = System.getenv( "SONATYPE_USERNAME" ) ?: sonatypeUsername
161+
password = System.getenv( "SONATYPE_PASSWORD" ) ?: sonatypePassword
162+
}
163+
}
164+
}

buildSrc/src/main/kotlin/flatlaf-publish.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,26 @@ publishing {
8686
}
8787
}
8888

89+
/*
8990
repositories {
9091
maven {
91-
name = "OSSRH"
92+
name = "MavenCentral"
9293
93-
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
94-
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
94+
val releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
95+
val snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
9596
url = uri( if( rootProject.hasProperty( "release" ) ) releasesRepoUrl else snapshotsRepoUrl )
9697
9798
credentials {
9899
// get from gradle.properties
99-
val ossrhUsername: String? by project
100-
val ossrhPassword: String? by project
100+
val sonatypeUsername: String? by project
101+
val sonatypePassword: String? by project
101102
102-
username = System.getenv( "OSSRH_USERNAME" ) ?: ossrhUsername
103-
password = System.getenv( "OSSRH_PASSWORD" ) ?: ossrhPassword
103+
username = System.getenv( "SONATYPE_USERNAME" ) ?: sonatypeUsername
104+
password = System.getenv( "SONATYPE_PASSWORD" ) ?: sonatypePassword
104105
}
105106
}
106107
}
108+
*/
107109
}
108110

109111
signing {

flatlaf-core/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,8 @@ flatlafPublish {
158158
NativeArtifact( "${natives}/libflatlaf-linux-x86_64.so", "linux-x86_64", "so" ),
159159
NativeArtifact( "${natives}/libflatlaf-linux-arm64.so", "linux-arm64", "so" ),
160160
)
161+
162+
// Maven Central Snapshots repo currently does not accept .dylib files
163+
if( version.toString().endsWith( "-SNAPSHOT" ) )
164+
nativeArtifacts = nativeArtifacts?.filter { it.type != "dylib" }
161165
}

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ errorprone = "com.google.errorprone:error_prone_core:2.20.0"
5858

5959

6060
[plugins]
61+
gradle-nexus-publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0" }
6162
errorprone = { id = "net.ltgt.errorprone", version = "3.1.0" }

0 commit comments

Comments
 (0)