diff --git a/clients/algoliasearch-client-java/.github/workflows/release.yml b/clients/algoliasearch-client-java/.github/workflows/release.yml index 30ca982db68..da75bf10ed0 100644 --- a/clients/algoliasearch-client-java/.github/workflows/release.yml +++ b/clients/algoliasearch-client-java/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: release: - name: Publish to Sonatype + name: Publish to Maven Central runs-on: ubuntu-22.04 if: "startsWith(github.event.head_commit.message, 'chore: release')" steps: @@ -26,8 +26,8 @@ jobs: - name: Upload Artifacts run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }} ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_PRIVATE_KEY_ID }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PRIVATE_KEY_PASSWORD }} diff --git a/clients/algoliasearch-client-java/api/build.gradle b/clients/algoliasearch-client-java/api/build.gradle index 689809f500d..a318b02cb3e 100644 --- a/clients/algoliasearch-client-java/api/build.gradle +++ b/clients/algoliasearch-client-java/api/build.gradle @@ -9,10 +9,7 @@ plugins { } repositories { - maven { - name = 'ossrh-staging-api' - url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/" - } + maven { url = "https://oss.sonatype.org/content/repositories/" } mavenCentral() } diff --git a/clients/algoliasearch-client-kotlin/.github/workflows/release.yml b/clients/algoliasearch-client-kotlin/.github/workflows/release.yml index c6cd18c2c03..e055f252f3c 100644 --- a/clients/algoliasearch-client-kotlin/.github/workflows/release.yml +++ b/clients/algoliasearch-client-kotlin/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: publish: - name: Publish to Sonatype + name: Publish to Maven Central runs-on: macos-14 if: "startsWith(github.event.head_commit.message, 'chore: release')" steps: @@ -26,8 +26,8 @@ jobs: - name: Upload Artifacts run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }} ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_PRIVATE_KEY_ID }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PRIVATE_KEY_PASSWORD }} diff --git a/clients/algoliasearch-client-scala/.github/workflows/release.yml b/clients/algoliasearch-client-scala/.github/workflows/release.yml index 276172af951..aa7f8edf5d3 100644 --- a/clients/algoliasearch-client-scala/.github/workflows/release.yml +++ b/clients/algoliasearch-client-scala/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: release: - name: Publish to Sonatype + name: Publish to Maven Central runs-on: ubuntu-22.04 if: "startsWith(github.event.head_commit.message, 'chore: release')" steps: @@ -24,23 +24,9 @@ jobs: - name: Compile run: sbt +compile - - name: Import GPG Key - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.SIGNING_PRIVATE_KEY }} - passphrase: ${{ secrets.SIGNING_PRIVATE_KEY_PASSWORD }} - fingerprint: ${{ secrets.SIGNING_PRIVATE_KEY_FINGERPRINT }} - - - name: List GPG keys - run: gpg -K - - - name: Publish Signed Artifacts + - run: sbt ci-release env: PGP_PASSPHRASE: ${{ secrets.SIGNING_PRIVATE_KEY_PASSWORD }} - run: sbt +publishSigned - - - name: Release Bundle to Sonatype - env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - run: sbt sonatypeBundleRelease + PGP_SECRET_KEY: ${{ secrets.SIGNING_PRIVATE_KEY }} + SONATYPE_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} diff --git a/clients/algoliasearch-client-scala/build.sbt b/clients/algoliasearch-client-scala/build.sbt index 7657247b21c..4b63d68511b 100644 --- a/clients/algoliasearch-client-scala/build.sbt +++ b/clients/algoliasearch-client-scala/build.sbt @@ -3,7 +3,6 @@ name := "algoliasearch-scala" description := "Scala client for Algolia Search API" scalaVersion := "2.13.16" crossScalaVersions := Seq("2.13.12", "3.6.3") -publishMavenStyle := true Test / publishArtifact := false licenses += ("MIT", url("https://opensource.org/licenses/MIT")) homepage := Some(url("https://github.com/algolia/algoliasearch-client-scala/")) @@ -23,8 +22,6 @@ developers += Developer( url("https://github.com/algolia/algoliasearch-client-scala/") ) -publishTo := sonatypePublishToBundle.value - lazy val root = project .in(file(".")) .enablePlugins(BuildInfoPlugin) diff --git a/clients/algoliasearch-client-scala/project/plugins.sbt b/clients/algoliasearch-client-scala/project/plugins.sbt index 68acc036327..95554643104 100644 --- a/clients/algoliasearch-client-scala/project/plugins.sbt +++ b/clients/algoliasearch-client-scala/project/plugins.sbt @@ -1,4 +1,3 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.5") diff --git a/config/generation.config.mjs b/config/generation.config.mjs index 0fdd537223f..a9138195418 100644 --- a/config/generation.config.mjs +++ b/config/generation.config.mjs @@ -11,6 +11,7 @@ export const patterns = [ '!clients/README.md', '!clients/**/.openapi-generator-ignore', 'clients/**/.github/**', + '!clients/**/.github/workflows/release.yml', // C# 'clients/algoliasearch-client-csharp/**', @@ -38,7 +39,6 @@ export const patterns = [ 'clients/algoliasearch-client-dart/packages/client_core/lib/src/version.dart', '!clients/algoliasearch-client-dart/packages/*/lib/src/extension.dart', '!clients/algoliasearch-client-dart/packages/algoliasearch/lib/algoliasearch.dart', - '!clients/algoliasearch-client-dart/.github/workflows/release.yml', // GO 'clients/algoliasearch-client-go/algolia/**', @@ -64,7 +64,6 @@ export const patterns = [ // JavaScript '!clients/algoliasearch-client-javascript/*', '!clients/algoliasearch-client-javascript/.yarn/**', - '!clients/algoliasearch-client-javascript/.github/workflows/release.yml', '!clients/algoliasearch-client-javascript/scripts/**', '!clients/algoliasearch-client-javascript/tests/**', // the release process is allowed to push changes to this file, but in general we don't because those files are generated diff --git a/generators/src/main/java/com/algolia/codegen/AlgoliaScalaGenerator.java b/generators/src/main/java/com/algolia/codegen/AlgoliaScalaGenerator.java index 0bbfd930cfe..03ca579ce6f 100644 --- a/generators/src/main/java/com/algolia/codegen/AlgoliaScalaGenerator.java +++ b/generators/src/main/java/com/algolia/codegen/AlgoliaScalaGenerator.java @@ -150,14 +150,16 @@ private CodegenProperty innerFromProperty( CodegenProperty property ) { if (p == null) { - this.logger.severe("Undefined property/schema for `" + name + "`. Default to type:string."); + // this.logger.severe("Undefined property/schema for `" + name + "`. Default to + // type:string."); return null; } else { - this.logger.severe("debugging fromProperty for " + name + ": " + p); + // this.logger.severe("debugging fromProperty for " + name + ": " + p); NamedSchema ns = new NamedSchema(name, p, required, schemaIsFromAdditionalProperties); CodegenProperty cpc = (CodegenProperty) this.schemaCodegenPropertyCache.get(ns); if (cpc != null) { - this.logger.info("Cached fromProperty for " + name + " : " + p.getName() + " required=" + required); + // this.logger.info("Cached fromProperty for " + name + " : " + p.getName() + " required=" + + // required); return cpc; } else { Schema refToPropertiesSchema = ModelUtils.getSchemaFromRefToSchemaWithProperties(this.openAPI, p.get$ref()); diff --git a/templates/java/gradle.properties.mustache b/templates/java/gradle.properties.mustache index 59e5acb2f57..e2eac17ef0f 100644 --- a/templates/java/gradle.properties.mustache +++ b/templates/java/gradle.properties.mustache @@ -1,10 +1,6 @@ GROUP={{groupId}} VERSION_NAME={{packageVersion}} -SONATYPE_HOST=DEFAULT -RELEASE_SIGNING_ENABLED=true -SONATYPE_AUTOMATIC_RELEASE=true - # POM POM_DESCRIPTION=Java client for Algolia Search API POM_URL=https://github.com/algolia/algoliasearch-client-java @@ -19,3 +15,8 @@ POM_DEVELOPER_NAME=The Algolia Team POM_DEVELOPER_EMAIL=hey@algolia.com POM_ISSUE_SYSTEM=github POM_ISSUE_URL=https://github.com/algolia/algoliasearch-client-java/issues + +# Publishing +mavenCentralPublishing=true +mavenCentralAutomaticPublishing=true +signAllPublications=true diff --git a/templates/kotlin/gradle.properties.mustache b/templates/kotlin/gradle.properties.mustache index 41ec0215a19..b9af3e6c564 100644 --- a/templates/kotlin/gradle.properties.mustache +++ b/templates/kotlin/gradle.properties.mustache @@ -6,10 +6,6 @@ kotlin.mpp.stability.nowarn=true GROUP={{groupId}} VERSION_NAME={{packageVersion}} -# OSS -SONATYPE_HOST=DEFAULT -RELEASE_SIGNING_ENABLED=true - # POM POM_DESCRIPTION="Algolia is a powerful search-as-a-service solution, made easy to use with API clients, UI libraries, \ and pre-built integrations. Algolia API Client for Kotlin lets you easily use the Algolia Search \ @@ -26,3 +22,8 @@ POM_DEVELOPER_NAME=The Algolia Team POM_DEVELOPER_EMAIL=hey@algolia.com POM_ISSUE_SYSTEM=github POM_ISSUE_URL=https://github.com/algolia/algoliasearch-client-kotlin/issues + +# Publishing +mavenCentralPublishing=true +mavenCentralAutomaticPublishing=true +signAllPublications=true