Skip to content

Commit de0cee8

Browse files
committed
TMP
1 parent 6381b7b commit de0cee8

File tree

3 files changed

+36
-49
lines changed

3 files changed

+36
-49
lines changed

.github/workflows/ossrh-publish.yml

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

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
# Import GPG signing key for Maven Central (from secrets)
20+
gpg-private-key: ${{ secrets.SIGNING_KEY_ID }}
21+
gpg-passphrase: ${{ secrets.SIGNING_PASSWORD }}
22+
23+
- name: Publish to Sonatype Central
24+
env:
25+
# Pass Sonatype portal token credentials to Gradle
26+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
27+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
28+
run: ./gradlew clean publishToSonatype closeAndReleaseSonatypeStagingRepository

build.gradle

Lines changed: 8 additions & 8 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

@@ -171,15 +171,15 @@ publishing {
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
}

0 commit comments

Comments
 (0)