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
The release process for SNAPSHOT versions is handled by the `after_success.sh` script, triggered after Travis CI successfully completes a non-PR build. A new SNAPSHOT artifact will be released to the snapshot repository as part of this script.
4
-
5
-
### To push a release version
1
+
One-time setup
2
+
==============
3
+
4
+
Set up Sonatype Account
5
+
-----------------------
6
+
* Sign up for a Sonatype JIRA account [here](https://issues.sonatype.org)
7
+
* Click *Sign Up* in the login box, follow instructions
8
+
9
+
Get access to repository
10
+
------------------------
11
+
* Go to [community support](https://issues.sonatype.org/browse/OSSRH)
12
+
* Ask for publish rights by creating an issue similar to [this one](https://issues.sonatype.org/browse/OSSRH-32032)
13
+
* You must be logged in to create a new issue
14
+
* Use the *Create* button at the top tab
15
+
16
+
Set up PGP keys
17
+
---------------
18
+
* Install GNU Privacy Guard (GPG)
19
+
* GPG is installed by default on Ubuntu systems
20
+
* For other systems, see [GnuPG download page](https://www.gnupg.org/download/)
21
+
22
+
* Generate the key ```gpg --gen-key```
23
+
* Keep the defaults, but specify a passphrase
24
+
* The passphrase can be random; you just need to remember it long enough to finish the next step
25
+
* One way to make a random passphrase: ```base64 /dev/urandom | head -c20; echo;```
26
+
27
+
* Find the ID of your public key ```gpg --list-secret-keys```
28
+
* Look for the line with format ```sec 2048R/ABCDEFGH 2015-11-17```
29
+
* The ```ABCDEFGH``` is the ID for your public key
30
+
31
+
* Upload your public key to a public server: ```gpg --send-keys --keyserver hkp://pgp.mit.edu ABCDEFGH```
32
+
33
+
Create a Maven settings file
34
+
----------------------------
35
+
* Create a file at ```$HOME/.m2/settings.xml``` with your passphrase and your sonatype username and password
36
+
```
37
+
<settings>
38
+
<profiles>
39
+
<profile>
40
+
<id>ossrh</id>
41
+
<activation>
42
+
<activeByDefault>true</activeByDefault>
43
+
</activation>
44
+
<properties>
45
+
<gpg.executable>gpg</gpg.executable>
46
+
<gpg.passphrase>[the password for your gpg key]</gpg.passphrase>
1. Make sure the team agrees that it is time to release.
8
74
@@ -19,10 +85,19 @@ This script takes optional arguments denoting the new versions for each qualifie
19
85
git add .
20
86
git commit -m "Release [VERSION HERE]"
21
87
```
22
-
88
+
89
+
1. Make sure you are using Maven version 3.3 or higher to support the Nexus plugin required to stage a release.
90
+
91
+
1. To ensure a clean build, remove *all* Maven targets (including subdirectories not handled by `mvn clean`) by running `rm -rf target */target`.
92
+
23
93
5. Run `utilities/stage_release.sh`.
24
94
This script builds and stages the release artifact on the Maven Central Repository, updates the README.md files with the release version + commits them locally, and finally generates a new site version for the gh-pages branch under a temporary directory named `tmp_gh-pages`. If you haven't run the release process before, it's worth verifying everything; check the staged release on the Sonatype website, and verify that the local commits have the right version updates.
25
95
96
+
If you experience failures, you may need to:
97
+
- repeat the clean step above
98
+
- remove the temporary directory created to store docs by running `rm -rf tmp_gh-pages`
99
+
- remove staged repositories from Sonatype (to prevent them from being released in subsequent steps): if a staged repository appears [here](https://oss.sonatype.org/#nexus-search;quick~com.google.cloud), remove it by running `mvn nexus-staging:drop`.
100
+
26
101
6. Run `utilities/finalize_release.sh`.
27
102
This script will release the staged artifact on the Maven Central Repository and push the README.md and gh-pages updates to github.
28
103
@@ -31,16 +106,20 @@ Go to the [releases page](https://github.com/GoogleCloudPlatform/google-cloud-ja
31
106
32
107
Add the commits since the last release into the release draft. Try to group them into sections with related changes. Anything that is a breaking change needs to be marked with `*breaking change*`. Such changes are only allowed for alpha/beta modules and `@BetaApi` features.
33
108
34
-
Ensure that the format is consistent with previous releases (for an example, see the [0.1.0 release](https://github.com/GoogleCloudPlatform/google-cloud-java/releases/tag/v0.1.0)). After adding any missing updates and reformatting as necessary, publish the draft. Finally, create a new draft for the next release.
109
+
Ensure that the format is consistent with previous releases (for an example, see the [0.1.0 release](https://github.com/GoogleCloudPlatform/google-cloud-java/releases/tag/v0.1.0)). After adding any missing updates and reformatting as necessary, publish the draft.
110
+
111
+
1. Create a new draft for the next release. Note any commits not included in the release that have been submitted before the release commit, to ensure they are documented in the next release.
35
112
36
113
8. Run `utilities/update_versions.sh` again (to include "-SNAPSHOT" in the project version). Please refer to documentation in `utilities/update_versions.sh` for more details.
37
114
38
115
9. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/google-cloud-java/pull/227).
39
116
40
-
### To push a snapshot version
117
+
To push a snapshot version
118
+
==========================
41
119
42
-
Pushing a snapshot is completely automated. If "-SNAPSHOT" is included in the version denoted by the base directory's pom.xml, then an updated artifact will be pushed to the snapshot repository when Travis CI successfully completes a non-PR build.
120
+
Pushing a snapshot is completely automated. If "-SNAPSHOT" is included in the version denoted by the base directory's pom.xml, then an updated artifact will be pushed to the snapshot repository when Travis CI successfully completes a non-PR build. The build triggers the `after_success.sh` script, which handles the release process for SNAPSHOT versions.
43
121
44
-
### Improvements
122
+
Improvements
123
+
============
45
124
46
125
Automatic tagging is not currently implemented, though it was discussed in [#119](https://github.com/GoogleCloudPlatform/google-cloud-java/pull/119). If the version updates continue to be manual, a one-line git tag command can be added to `after_success.sh` to correctly tag releases. However, automatically creating useful annotations for this tag will be difficult. Also, if the release process becomes fully automated, tagging becomes a harder problem, as mentioned in that issue.
0 commit comments