Skip to content

Commit b91b92b

Browse files
authored
Merge branch 'main' into feat/add-ai-powered-search
2 parents 5a29190 + b5a0705 commit b91b92b

File tree

8 files changed

+64
-82
lines changed

8 files changed

+64
-82
lines changed

.code-samples.meilisearch.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,14 @@ getting_started_add_documents: |-
459459
// <dependency>
460460
// <groupId>com.meilisearch.sdk</groupId>
461461
// <artifactId>meilisearch-java</artifactId>
462-
// <version>0.14.5</version>
462+
// <version>0.14.6</version>
463463
// <type>pom</type>
464464
// </dependency>
465465
466466
// For Gradle
467467
// Add the following line to the `dependencies` section of your `build.gradle`:
468468
//
469-
// implementation 'com.meilisearch.sdk:meilisearch-java:0.14.5'
469+
// implementation 'com.meilisearch.sdk:meilisearch-java:0.14.6'
470470
471471
// In your .java file:
472472
import com.meilisearch.sdk;

.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

CONTRIBUTING.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -199,29 +199,22 @@ gpg --gen-key --batch genkey
199199
gpg --keyserver hkp://keyserver.ubuntu.com --send-keys <last-8-digits-of-your-key-hash>
200200
```
201201

202-
5. Export the gpg key in a secring.gpg file
202+
5. Export the gpg key in a signing-key.asc armored file
203203

204204
```bash
205-
gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
206-
```
207-
208-
6. Encode the secring in base64 and store it (Used by the ossrh-publish workflow)
209-
210-
```bash
211-
base64 ~/.gnupg/secring.gpg > secring.gpg.b64
205+
gpg --armor --export-secret-keys $KEY_ID > signing-key.asc
212206
```
213207

214208
#### Sign your files and upload to Maven Repository manually <!-- omit in TOC -->
215209

216210
1. Set the environment variables listed below with the required credentials:
217211

218212
```bash
219-
export OSSRH_USERNAME=<maven-username>
220-
export OSSRH_PASSWORD=<maven-password>
213+
export MAVEN_CENTRAL_USERNAME=<maven-username>
214+
export MAVEN_CENTRAL_PASSWORD=<maven-password>
221215

222216
export SIGNINT_KEY_ID=<id-associated-to-the-gpg-key>
223217
export SIGNING_PASSWORD=<passphrase-associated-to-the-gpg-key>
224-
export SIGNING_SECRET_KEY_RING_FILE=<path-to-gpg-key-encoded-in-base64>
225218
```
226219

227220
2. Decode the gpg key
@@ -235,13 +228,13 @@ base64 -d $SIGNING_SECRET_KEY_RING_FILE > secring.gpg
235228
```bash
236229
# May need sudo privilege and JDK8
237230
./gradlew build
238-
./gradlew publish -Psigning.keyId=$SIGNING_KEY_ID -Psigning.password=$SIGNING_PASSWORD -Psigning.secretKeyRingFile=$(echo secring.gpg)
231+
TODO
239232
```
240233

241-
4. Login to [Sonatype Nexus](https://oss.sonatype.org).
242-
5. Navigate to `Staging repositories`.
243-
6. Close your repository by clicking on the `Close` button. Checks will be made by nexus. It might take time. If any error occurs, it will be visible in the `Activity` tab.
244-
7. Once the check have succeeded, you should be able to click on the `Release` button. The release will be now processed and might take a long time to appear in [Maven Central](https://search.maven.org/artifact/com.meilisearch.sdk/meilisearch-java).
234+
4. Login to [Sonatype Nexus](https://central.sonatype.com/).
235+
5. Navigate to `Deployments`.
236+
6. Checks will be made by Sonatype. It might take time. If any error occurs, it will be visible in the `Deployments` tab (last one).
237+
7. Once the check have succeeded, the release will be now processed and it will appear in [Maven Central](https://central.sonatype.com/artifact/com.meilisearch.sdk/meilisearch-java/versions).
245238

246239
<hr>
247240

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Add the following code to the `<dependencies>` section of your project:
5858
<dependency>
5959
<groupId>com.meilisearch.sdk</groupId>
6060
<artifactId>meilisearch-java</artifactId>
61-
<version>0.14.5</version>
61+
<version>0.14.6</version>
6262
<type>pom</type>
6363
</dependency>
6464
```
@@ -68,7 +68,7 @@ Add the following code to the `<dependencies>` section of your project:
6868
Add the following line to the `dependencies` section of your `build.gradle`:
6969

7070
```groovy
71-
implementation 'com.meilisearch.sdk:meilisearch-java:0.14.5'
71+
implementation 'com.meilisearch.sdk:meilisearch-java:0.14.6'
7272
```
7373

7474
:warning: `meilisearch-java` also requires `okhttp` as a peer dependency.

build.gradle

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ 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

1919
group = 'com.meilisearch.sdk'
2020
archivesBaseName = 'meilisearch-java'
21-
version = '0.14.5'
21+
version = '0.14.6'
2222

2323
java {
2424
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -39,6 +39,17 @@ jacocoTestCoverageVerification {
3939
}
4040
}
4141
}
42+
configurations.all {
43+
resolutionStrategy {
44+
componentSelection {
45+
all { ComponentSelection selection ->
46+
if (selection.candidate.version =~ /(?i).*[.-](alpha|beta|rc|m)[.\d-]*/) {
47+
selection.reject("Pre-release versions are not allowed")
48+
}
49+
}
50+
}
51+
}
52+
}
4253

4354
repositories {
4455
mavenCentral()
@@ -159,33 +170,25 @@ publishing {
159170
}
160171
}
161172
}
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-
}
171173
}
172174

173175
nexusPublishing {
174-
packageGroup = "com.meilisearch"
175-
176176
repositories {
177177
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')
178+
// Point to new Central Portal staging API (replaces oss.sonatype.org)
179+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
180+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
181+
// Credentials: use Central Portal token (username/password)
182+
username.set(System.getenv("MAVEN_CENTRAL_USERNAME")) // portal token user
183+
password.set(System.getenv("MAVEN_CENTRAL_PASSWORD")) // portal token password
184+
// packageGroup or stagingProfileId not needed if using nexus-publish-plugin
183185
}
184186
}
185187
}
186188

187189
signing {
188-
sign publishing.publications.mavenJava
190+
useInMemoryPgpKeys(System.getenv("MAVEN_CENTRAL_SIGNING_KEY"), System.getenv("MAVEN_CENTRAL_SIGNING_PASSWORD"))
191+
sign(publishing.publications["mavenJava"])
189192
}
190193

191194
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

src/main/java/com/meilisearch/sdk/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.meilisearch.sdk;
22

33
public class Version {
4-
static final String VERSION = "0.14.5";
4+
static final String VERSION = "0.14.6";
55

66
public static String getQualifiedVersion() {
77
return "Meilisearch Java (v" + VERSION + ")";

0 commit comments

Comments
 (0)