-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gradle] Reworking publishing pipeline #2886
Conversation
TravisCI proxies separate external requests with different orginating IP addresses, while Sonatype associates artifacts for auto-generated repositories by IP address. This leads to many gradle deploys from CI resulting in "split" staging repositories with no way to combine in Sonatype Nexus. This introduces a workflow which should resolve this issue on the next revision release. Specifically, nexus-publish-plugin is included to create singular staging repositories from TravisCI and gradle-nexus-staging-plugin is included to auto-release and promote this repository. NOTE: We need to publish via publishPluginMavenPublicationToNexusRepository, because publishToNexus will publish _all_ publish-related tasks, including the one intended only for the Gradle Plugin Portal. Tested in standalone open source Nexus Repo Manager, which doesn't support the staging plugin. So, only SNAPSHOT workflow has been validated locally.
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
@@ -136,8 +136,8 @@ after_success: | |||
echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; | |||
pushd .; | |||
cd modules/openapi-generator-gradle-plugin; | |||
./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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the 4.0.1 release fails, we may consider reverting to the uploadArchives
and maven
publishing plugin.
.travis.yml
Outdated
./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"; | ||
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" publishPluginMavenPublicationToNexusRepository --no-daemon; | ||
echo "Finished ./gradlew publishPluginMavenPublicationToNexusRepository"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to see how this goes, but I guess that calling the task closeAndReleaseRepository
would also be necessary. (the maven nexus plugin is doing something like this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually the SNAPSHOT path (master), but your comment made me realize that I had completely missed updating the uploadArchives
in the following conditional block which is used for releases. I believe the releases branch is the only one that requires closing.
Because of the change |
Now it is failing because of this error:
I think there is a way to say that signing is only for release version: |
@jmini thanks for also looking into this. Seems I'll need to work out the release signing for maven-publish. I'll try and get to that on the next day or so. |
In digging a little more, it seems we will need to call Here's the task graph of the target task:
|
…task guard, and publish to Gradle Plugin portal only on tagged build.
* 4.1.x: (56 commits) sync master Update compatibility table Ruby client: escape path parameters (OpenAPITools#3039) [gradle plugin] Release 4.0.1 fixes (OpenAPITools#3051) Update version to 4.0.2-SNAPSHOT (OpenAPITools#3047) Map number to double time since float is also parsed as double in Qt5 C++ (OpenAPITools#3046) Prepare 4.0.1 release (OpenAPITools#3041) [gradle] Reworking publishing pipeline (OpenAPITools#2886) [typescript-fetch] Fix uploading files (OpenAPITools#2900) Resolves OpenAPITools#2962 - Add properties config to Maven parameters (OpenAPITools#2963) fix(golang): Check error of xml Encode (OpenAPITools#3027) [C++][Restbed] Add handler callback methods (OpenAPITools#2911) Remove null checks for C# value types (OpenAPITools#2933) [python-server] Support python 3.7 for all server-generators (OpenAPITools#2884) Use golang's provided method names (gin) (OpenAPITools#2983) [python] Adding constructor parameters to Configuration and improving documentation (OpenAPITools#3002) Add new option to maven plugin's readme (OpenAPITools#3025) Engine param in maven plugin. (OpenAPITools#2881) Added support for patterns on model properties (OpenAPITools#2948) [csharp] Make API response headers dictionary case insensitive (OpenAPITools#2998) ...
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.master
,. Default:3.4.x
,4.0.x
master
.Description of the PR
TravisCI proxies separate external requests with different orginating IP
addresses, while Sonatype associates artifacts for auto-generated
repositories by IP address. This leads to many gradle deploys from CI
resulting in "split" staging repositories with no way to combine in
Sonatype Nexus.
This introduces a workflow which should resolve this issue on the next
revision release. Specifically, nexus-publish-plugin is included to
create singular staging repositories from TravisCI and
gradle-nexus-staging-plugin is included to auto-release and promote
this repository.
NOTE:
We need to publish via
publishPluginMavenPublicationToNexusRepository
,because
publishToNexus
will publish all publish-related tasks,including the one intended only for the Gradle Plugin Portal.
Tested in standalone open source Nexus Repo Manager, which doesn't
support the staging plugin. So, only SNAPSHOT workflow has been
validated locally.
The
enableFeaturePreview('STABLE_PUBLISHING')
option in settings.gradle is a warning presented by the new nexus-publish-plugin:This PR is an attempt at resolving #411
cc @OpenAPITools/generator-core-team