Skip to content

Commit dc75a1f

Browse files
committed
TMP
1 parent 6381b7b commit dc75a1f

File tree

4 files changed

+47
-60
lines changed

4 files changed

+47
-60
lines changed

.github/workflows/ossrh-publish.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish to Maven Central
2+
3+
on:
4+
push:
5+
tags: ["v*"] # Trigger on version tag pushes (adjust as needed)
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: 'temurin'
18+
java-version: '17'
19+
20+
- name: Publish to Sonatype Central
21+
env:
22+
# Pass Sonatype portal token credentials to Gradle
23+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
24+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
25+
MAVEN_CENTRAL_SIGNING_KEY: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY }}
26+
MAVEN_CENTRAL_SIGNING_PASSWORD: ${{ secrets.MAVEN_CENTRAL_SIGNING_PASSWORD }}
27+
run: ./gradlew clean publishToSonatype closeAndReleaseSonatypeStagingRepository

build.gradle

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212
id 'maven-publish'
1313
id 'signing'
1414
id 'jacoco'
15-
id 'io.github.gradle-nexus.publish-plugin' version "2.0.0"
15+
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
1616
id "com.diffplug.spotless" version "6.13.0"
1717
}
1818

@@ -159,33 +159,34 @@ publishing {
159159
}
160160
}
161161
}
162-
repositories {
163-
maven {
164-
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
165-
credentials {
166-
username System.getenv('OSSRH_USERNAME')
167-
password System.getenv('OSSRH_PASSWORD')
168-
}
169-
}
170-
}
162+
// repositories {
163+
// maven {
164+
// url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
165+
// credentials {
166+
// username System.getenv('OSSRH_USERNAME')
167+
// password System.getenv('OSSRH_PASSWORD')
168+
// }
169+
// }
170+
// }
171171
}
172172

173173
nexusPublishing {
174-
packageGroup = "com.meilisearch"
175-
176174
repositories {
177175
sonatype {
178-
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
179-
180-
username = System.getenv('OSSRH_USERNAME')
181-
password = System.getenv('OSSRH_PASSWORD')
182-
stagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID')
176+
// Point to new Central Portal staging API (replaces oss.sonatype.org)
177+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
178+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
179+
// Credentials: use Central Portal token (username/password)
180+
username.set(System.getenv("MAVEN_CENTRAL_USERNAME")) // portal token user
181+
password.set(System.getenv("MAVEN_CENTRAL_PASSWORD")) // portal token password
182+
// packageGroup or stagingProfileId not needed if using nexus-publish-plugin
183183
}
184184
}
185185
}
186186

187187
signing {
188-
sign publishing.publications.mavenJava
188+
useInMemoryPgpKeys(System.getenv("MAVEN_CENTRAL_SIGNING_KEY"), System.getenv("MAVEN_CENTRAL_SIGNING_PASSWORD"))
189+
sign(publishing.publications["mavenJava"])
189190
}
190191

191192
javadoc {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)