Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/ossrh-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ jobs:
run: |
echo "${{secrets.SIGNING_SECRET_KEY_RING_FILE}}" > ~/.gradle/secring.gpg.b64
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg
- name: Publish, close and release Nexus Repository
run: ./gradlew publishToSonatype closeAndReleaseStagingRepositories -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
- name: Publish to Maven Central
run: ./gradlew publish --info -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
env:
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}}
SONATYPE_STAGING_PROFILE_ID: ${{secrets.SONATYPE_STAGING_PROFILE_ID}}
MAVEN_BEARER: ${{secrets.MAVEN_BEARER}}
74 changes: 25 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,25 @@
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'maven-publish'
id 'signing'

id 'jacoco'
id 'io.github.gradle-nexus.publish-plugin' version "2.0.0"
id "com.diffplug.spotless" version "6.13.0"

id 'maven-publish'
id 'signing'
// Sonatype Nexus Publish Plugin
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}

group = 'com.meilisearch.sdk'
archivesBaseName = 'meilisearch-java'
version = '0.14.5'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

withJavadocJar()
withSourcesJar()
}

jacoco {
Expand All @@ -44,10 +49,6 @@ repositories {
mavenCentral()
}

configurations {
testCompile.extendsFrom compileOnly
}

dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.code.gson:gson:2.12.1'
Expand Down Expand Up @@ -78,19 +79,6 @@ dependencies {
implementation 'com.auth0:java-jwt:4.5.0'
}

task buildJar(type: Jar) {
archiveBaseName = 'meilisearch-java'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
{
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
with jar
}

test {
finalizedBy jacocoTestReport
useJUnitPlatform {
Expand Down Expand Up @@ -122,11 +110,6 @@ task integrationTest(type: Test) {
}
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down Expand Up @@ -159,29 +142,6 @@ publishing {
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username System.getenv('OSSRH_USERNAME')
password System.getenv('OSSRH_PASSWORD')
}
}
}
}

nexusPublishing {
packageGroup = "com.meilisearch"

repositories {
sonatype {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))

username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
stagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID')
}
}
}

signing {
Expand All @@ -203,3 +163,19 @@ spotless {
googleJavaFormat('1.7').aosp()
}
}


// Nexus Publish Plugin configuration
nexusPublishing {
packageGroup.set("com.meilisearch")

repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))

username.set(System.getenv('MAVEN_CENTRAL_USERNAME'))
password.set(System.getenv('MAVEN_CENTRAL_PASSWORD'))
}
}
}
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
package:
image: azul/zulu-openjdk:8-latest
Expand Down
Empty file removed gradle.properties
Empty file.
Loading