You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Publish by using Portal OSSRH Staging API
Updates the current release process to publish artifacts to the Sonatype
Central Portal instead of Sonatype OSSRH using their staging API that is
intended to reduce friction while migrating.
* Udpate releasing information
* Fix spotless checks
* Update publishing information in RELEASING
* Address comments
> These instructions are for modern linux where `gpg` refers to the 2.0 version.
48
41
49
-
If you're running in linux and would like to use the GPG agent to remember your PGP key passwords instead of keeping them in a plain-text file on your home directory,
50
-
you can configure the following in `<your-home-directory>/.gradle/gradle.properties`:
42
+
You can configure Gradle to use GPG by adding the following in
signing.gnupg.keyName=<secret key id (large hash)>
52
+
53
+
checkstyle.ignoreFailures=false
59
54
```
60
-
Note: You can retrieve the list of previously created GPG keys on your machine by using `gpg --list-secret-keys`.
55
+
56
+
Note: You can retrieve the list of previously created GPG keys on your machine
57
+
by using `gpg --list-secret-keys`. Additionally, you can use a GPG Agent and/or
58
+
a password manager (or the built-in Keyring) to avoid entering the password
59
+
manually.\
60
+
For more details, checkout the
61
+
[help section](#help-timeout-with-gpg-operations) on the bottom
62
+
of this guide.
61
63
62
64
> [!IMPORTANT]
63
-
> Starting June 2024, due to a change to the OSSRH authentication backend, the maven publish plugin now requires [a user token](https://central.sonatype.org/publish/generate-token/) instead of a typical username and password used in the Nexus UI.
64
-
> Follow the steps in the [link](https://central.sonatype.org/publish/generate-token/) to generate a user token, if not done already - this will provide you with a `tokenuser` and `tokenkey`. Replace `<generated-token-user>` and `<generated-token-key>` with the generated `tokenuser` and `tokenkey` in your `gradle.properties` file to successfully publish artifacts.
65
+
> The user tokens for publishing to the Central Portal are different from those
66
+
> used for OSSRH. If you haven't already, you must generate a new Portal Token
67
+
> to publish to the Central Portal.
68
+
> Follow the steps in this
69
+
> [link](https://central.sonatype.org/publish/generate-portal-token/) to
70
+
> generate a user token - this will provide you with a Portal token containing a
71
+
> `username` and `password`. Replace `<generated-token-user>` and
72
+
> `<generated-token-key>` with the generated `username` and `password` in your
73
+
> `gradle.properties` file to successfully publish artifacts.
If you've followed the above steps, you can release snapshots for consumption using the following:
83
+
If you've followed the above steps, you can release snapshots for consumption
84
+
using the following:
75
85
76
86
```bash
77
87
$ ./gradlew snapshot
78
88
```
79
89
80
-
## Releasing a Candidate (Optional)
90
+
SNAPSHOT releases are intended for developers to make pre-release versions of
91
+
their projects available for testing. Published snapshots should be visible
92
+
using the
93
+
[directory listing for com.google.cloud.opentelemetry](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/google/cloud/opentelemetry/)
*Note: If you do not have a CredentialsProvider registered for GitHub, the `candidate` task may fail to upload tags to the GitHub repository and the overall command may take a long time to report completion on the task. In this case, before moving forward - check if tags were pushed to GitHub. If not, manually push the tags before continuing.*\
113
-
*Next, check if the staging repository is created on the [nexus repository manager](https://oss.sonatype.org/#stagingRepositories). If the repository is already created, continue with the next steps.*
114
-
115
-
Follow [Releasing on Maven Central](#releasing-on-maven-central) to close + publish the
116
-
[repository on OSSRH](https://oss.sonatype.org/#stagingRepositories).
117
-
118
-
After this, follow the [Announcment](#Announcement) documentation to advertise the release and update README files.
119
-
145
+
*Note: If you do not have a CredentialsProvider registered for GitHub, the
146
+
`candidate` task may fail to upload tags to the GitHub repository and the
147
+
overall command may take a long time to report completion on the task.
148
+
In this case, before moving forward - check if tags were pushed to GitHub.
149
+
If not, manually push the tags before continuing.*\
120
150
121
151
Note: In the future, the `-Prelease.version` flag should not be required.
122
152
@@ -130,37 +160,61 @@ gone through code review. For the current release use:
The task will respond with an HTTP status code. If the status code is 200, the
178
+
artifacts are successfully uploaded on the Central Portal and should be visible
179
+
on the UI.
144
180
145
-
### Things to check before 'closing' on Maven Central
181
+
##Releasing on Maven Central
146
182
147
-
Before closing the staging repository, it is important to verify that the contents of all the
148
-
published modules are looking good. Particularly, the version numbers should be what are expected,
149
-
and they include any custom release qualifiers (like 'alpha') which are set. Make sure that:
150
-
- The generated POM files for the individual module have the correct version number.
151
-
- The dependencies for an individual module in the POM file are the expected ones & they dependencies have the correct versions.
152
-
- The module content includes all the artifacts that are expected to be published - for instance, sourcesJar, javadocs, additional variants like a shaded JAR in some cases, etc.
183
+
Once all the artifacts have been pushed to the Central Portal, a `deployment`
184
+
will be created in the Central Portal. This deployment is visible under the
185
+
"Deployments" tab on https://central.sonatype.com/publishing (you will have to
186
+
log in with your account).\
187
+
At this point, you can either manually 'Drop' or 'Publish' the deployment.
188
+
- Publishing the deployment will make the new release available on Maven
189
+
Central.
190
+
- Dropping the deployment will close the deployment and abandon the release.
191
+
You should drop the deployment if you do not wish to proceed with release
192
+
process for any reason.
193
+
194
+
### Things to check before 'Publishing' on Maven Central
195
+
196
+
Before publishing the release, it is important to verify that the
197
+
contents of all the published modules are looking good. Particularly, the
198
+
version numbers should be what are expected, and they include any custom release
199
+
qualifiers (like 'alpha') which are set. Make sure that:
200
+
- The generated POM files for the individual module have the correct version
201
+
number.
202
+
- The dependencies for an individual module in the POM file are the expected
203
+
ones & the dependencies have the correct versions.
204
+
- The module content includes all the artifacts that are expected to be
205
+
published - for instance, sourcesJar, javadocs, additional variants like a
206
+
shaded JAR in some cases, etc.
153
207
- The file sizes for the published artifacts should seem reasonable.
to view a summary of all commits since last release as a reference.
165
219
166
220
Please pick major or important user-visible changes only.
@@ -176,10 +230,7 @@ $ COMMIT=1224f0a # Set the right commit hash.
176
230
$ git cherry-pick -x $COMMIT
177
231
```
178
232
179
-
### Help: Timeout during key-generation process
180
-
If you see timeout errors when you run `gpg --gen-key` to generate your keys, it maybe because you are running the command on a server and do not have access to a UI.
181
-
A common example is - running this command on a remote machine over ssh.
182
-
183
-
The issue here is that this command opens up a UI dialog asking for you to set a passphrase, waiting for input for a fixed time.
184
-
185
-
The easiest way to fix this is to run it on a machine for which you have UI access.
233
+
### Help: Timeout with gpg operations
234
+
If you see a timeout error when running `gpg` commands, then you probably have a
235
+
graphical session with a gpg agent that is prompting you for a password. Check
0 commit comments