Skip to content

CI: Rework publish pipeline for "openapi-generator-gradle-plugin" #411

@jmini

Description

@jmini

The automated deploy of the openapi-generator-gradle-plugin is not working.

With 3.0.1 and 3.0.2 there was a TravisCI timeout in the job.
With 3.0.3 the TravisCI Job is OK.

Log: https://api.travis-ci.org/v3/job/397359374/log.txt

Maven deploy:

Source:

mvn clean deploy -DskipTests=true -B -U -P release --settings CI/settings.xml;
echo "Finished mvn clean deploy for $TRAVIS_BRANCH";

Log Extract: end of the maven deploy step:

Finished mvn clean deploy for master

Gradle Uplaoad:

Source:

./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" uploadArchives --no-daemon;
echo "Finished ./gradlew uploadArchives";

Log Extract for the uploadArchives task:

~/build/OpenAPITools/openapi-generator ~/build/OpenAPITools/openapi-generator

Welcome to Gradle 4.7!

Here are the highlights of this release:
 - Incremental annotation processing
 - JDK 10 support
 - Grouped non-interactive console logs
 - Failed tests are re-run first for quicker feedback

For more details see https://docs.gradle.org/4.7/release-notes.html

> Task :compileKotlin UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :pluginDescriptors UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :javadoc NO-SOURCE
> Task :javadocJar UP-TO-DATE
> Task :sourcesJar UP-TO-DATE
> Task :signArchives
> Task :uploadArchives

BUILD SUCCESSFUL in 3m 42s
8 actionable tasks: 2 executed, 6 up-to-date
Finished ./gradlew uploadArchives

The artefacts were uploaded to Nexus. But a look in the Staging repository show multiple staging repo:

https://oss.sonatype.org/#stagingRepositories

Nexus

Content of the different repos:

  • openapitools-1031 contains only:
    • /org/openapitools/openapi-generator-gradle-plugin/3.0.3/openapi-generator-gradle-plugin-3.0.3.pom.asc.md5
  • openapitools-1030 contains:
    • /org/openapitools/openapi-generator-gradle-plugin/3.0.3/openapi-generator-gradle-plugin-3.0.3-javadoc.jar.sha1
    • /org/openapitools/openapi-generator-gradle-plugin/3.0.3/openapi-generator-gradle-plugin-3.0.3-sources.jar
    • /org/openapitools/openapi-generator-gradle-plugin/3.0.3/openapi-generator-gradle-plugin-3.0.3.jar.asc.md5
  • … and so on
  • openapitools-1024

This is a known issue:

https://issues.sonatype.org/browse/OSSRH-37302?attachmentViewMode=list


I see multiple solutions:

1/ Use the nexus-staging-maven-plugin:

My understanding (see also #366) is that if we manage to install the artifacts (jars, pom, signature files) to <root repo>/target/nexus-staging/deferred/ during the maven build (as a regular step of the openapi-generator-gradle-plugin-mvn-wrapper project) then it will be uploaded in one step at the end of the build.

This is more or less what is recommended in OSSRH-37302

2/ Switch CI Server. According to @jimschubert there is no problem with GitLab-CI

3/ Switch Staging server.

  • Deploy to Bintray (instead of Sonatype Nexus)
  • From Bintray to JCenter and Maven Central (one click)

Bintray is free for Open Source project.

I think that a lot of projects using gradle are using Bintray. I think that AsciidoctorJ is doing it like this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions