Skip to content

Commit 5ec4fdc

Browse files
Update release instructions and scripts
1 parent 6678914 commit 5ec4fdc

3 files changed

Lines changed: 98 additions & 11 deletions

File tree

RELEASING.md

Lines changed: 87 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,72 @@
1-
### Overview
2-
3-
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+
Set up Sonatype Account
2+
-----------------------
3+
* Sign up for a Sonatype JIRA account [here](https://issues.sonatype.org)
4+
* Click *Sign Up* in the login box, follow instructions
5+
6+
Get access to repository
7+
------------------------
8+
* Go to [community support](https://issues.sonatype.org/browse/OSSRH)
9+
* Ask for publish rights by creating an issue similar to [this one](https://issues.sonatype.org/browse/OSSRH-32032)
10+
* You must be logged in to create a new issue
11+
* Use the *Create* button at the top tab
12+
13+
Set up PGP keys
14+
---------------
15+
* Install GNU Privacy Guard (GPG)
16+
* GPG is installed by default on Ubuntu systems
17+
* For other systems, see [GnuPG download page](https://www.gnupg.org/download/)
18+
19+
* Generate the key ```gpg --gen-key```
20+
21+
* Keep the defaults, but specify a passphrase
22+
* The passphrase can be random; you just need to remember it long enough to finish the next step
23+
* One way to make a random passphrase: ```base64 /dev/urandom | head -c20; echo;```
24+
25+
* Find the ID of your public key ```gpg --list-secret-keys```
26+
* Look for the line with format ```sec 2048R/ABCDEFGH 2015-11-17```
27+
* The ```ABCDEFGH``` is the ID for your public key
28+
29+
* Upload your public key to a public server: ```gpg --send-keys --keyserver hkp://pgp.mit.edu ABCDEFGH```
30+
31+
Create a Maven settings file
32+
----------------------------
33+
* Create a file at ```$HOME/.m2/settings.xml``` with your passphrase and your sonatype username and password
34+
```
35+
<settings>
36+
<profiles>
37+
<profile>
38+
<id>ossrh</id>
39+
<activation>
40+
<activeByDefault>true</activeByDefault>
41+
</activation>
42+
<properties>
43+
<gpg.executable>gpg</gpg.executable>
44+
<gpg.passphrase>[the password for your gpg key]</gpg.passphrase>
45+
</properties>
46+
</profile>
47+
</profiles>
48+
<servers>
49+
<server>
50+
<id>ossrh</id>
51+
<username>[your sonatype account name]</username>
52+
<password>[your sonatype account password]</password>
53+
</server>
54+
<server>
55+
<id>sonatype-nexus-snapshots</id>
56+
<username>[your sonatype account name]</username>
57+
<password>[your sonatype account password]</password>
58+
</server>
59+
<server>
60+
<id>sonatype-nexus-staging</id>
61+
<username>[your sonatype account name]</username>
62+
<password>[your sonatype account password]</password>
63+
</server>
64+
</servers>
65+
</settings>
66+
```
67+
68+
To push a release version
69+
-------------------------
670

771
1. Make sure the team agrees that it is time to release.
872

@@ -19,10 +83,19 @@ This script takes optional arguments denoting the new versions for each qualifie
1983
git add .
2084
git commit -m "Release [VERSION HERE]"
2185
```
22-
86+
87+
1. Make sure you are using Maven version 3.3 or higher to support the Nexus plugin required to stage a release.
88+
89+
1. To ensure a clean build, remove *all* Maven targets (including subdirectories not handled by `mvn clean`) by running `rm -rf target */target`.
90+
2391
5. Run `utilities/stage_release.sh`.
2492
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.
2593

94+
If you experience failures, you may need to:
95+
- repeat the clean step above
96+
- remove the temporary directory created to store docs by running `rm -rf tmp_gh-pages`
97+
- remove staged repositories from Sonatype: if a staged repository appears [here](https://oss.sonatype.org/#nexus-search;quick~com.google.cloud), remove it by running `mvn nexus-staging:drop`.
98+
2699
6. Run `utilities/finalize_release.sh`.
27100
This script will release the staged artifact on the Maven Central Repository and push the README.md and gh-pages updates to github.
28101

@@ -31,16 +104,20 @@ Go to the [releases page](https://github.com/GoogleCloudPlatform/google-cloud-ja
31104

32105
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.
33106

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.
107+
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.
108+
109+
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.
35110

36111
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.
37112

38113
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).
39114

40-
### To push a snapshot version
115+
To push a snapshot version
116+
--------------------------
41117

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.
118+
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.
43119

44-
### Improvements
120+
Improvements
121+
------------
45122

46123
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.

utilities/finalize_release.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@ mvn nexus-staging:release
88
git push
99

1010
# Push the gh-pages updates
11-
cd tmp_gh-pages
11+
pushd tmp_gh-pages
1212
git push
13+
popd
14+
15+
# Remove gh-pages temporary directory
16+
rm -rf tmp_gh-pages

utilities/update_versions.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ BETA_VERSION=""
7272
RC_VERSION=""
7373
GA_VERSION=""
7474

75+
# uncomment module for GAE testing apps to enable detection (re-commented below)
76+
sed -i -e 's:<!--<module>google-cloud-testing</module>-->:<module>google-cloud-testing</module>:' pom.xml
77+
7578
for i in "$@"
7679
do
7780
case $i in
@@ -269,3 +272,6 @@ for item in ${modules[*]}; do
269272
fi
270273
fi
271274
done
275+
276+
# re-comment module for GAE testing apps
277+
sed -i -e 's:<module>google-cloud-testing</module>:<!--<module>google-cloud-testing</module>-->:' pom.xml

0 commit comments

Comments
 (0)