Skip to content

Commit

Permalink
Simplify release process (#3799)
Browse files Browse the repository at this point in the history
* Cleanup maven release goals

* Only deploy the deployable artifacts.

Only use the nexus-staging-maven-plugin on deployable assets.
Set skip to true for deployment on non-deployable assets.

* Need to enable maven-gpg-plugin for release profile for google-cloud-clients and google-api-grpc

* Update release instructions. We no longer need to comment out the modules or plugin

* Cleanup

* remove extra comma
  • Loading branch information
chingor13 authored Oct 10, 2018
1 parent a2f6a05 commit 76e09ee
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 119 deletions.
25 changes: 8 additions & 17 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,37 +103,28 @@ To push a release version
assumes that there is no directory called `tmp_gh-pages` in the repository root. If it is
present, remove it before running the script.

8. Locally edit the root `pom.xml` so that `mvn deploy` works:
1. Under `<modules>`, comment out `google-cloud-examples`, `google-cloud-testing`, and
`google-cloud-util`.
2. Comment out the `nexus-staging-maven-plugin` plugin definition at the end of the file.

**Don't commit these changes.**

9. Check that you are not trying to release a SNAPSHOT build (the artifacts versions do not have
8. Check that you are not trying to release a SNAPSHOT build (the artifacts versions do not have
"-SNAPSHOT" suffix) and then run `mvn clean deploy -DskipTests=true --settings ~/.m2/settings.xml -P release`
command. It will build and deploy artifacts to the staging repository.

**Note:** you may need to specify the stagingProfileId with `-DstagingProfileId=3187e4f20d328b`
**Note:** you may need to specify the GPG tty with `GPG_TTY=$(tty)`

10. Uncomment the `nexus-staging-maven-plugin` plugin definition from step 8; This plugin is
needed to release the artifacts. Run `mvn nexus-staging:release` to release the artifacts.

11. Revert the local edits to your `pom.xml` performed a couple steps above by running `git checkout pom.xml`.
9. Run `mvn nexus-staging:release` to release the artifacts. If you wish to abort the release, run
`mvn nexus-staging:drop`.

12. Run `cd tmp_gh-pages && git push && cd ..` to push the previously generated docs (step 7).
10. Run `cd tmp_gh-pages && git push && cd ..` to push the previously generated docs (step 7).

13. Run `rm -rf tmp_gh-pages` to remove the generated docs directory from your local machine.
11. Run `rm -rf tmp_gh-pages` to remove the generated docs directory from your local machine.

14. Run `releasetool tag` to publish a release on Github. It will list the last few merged PRs.
12. Run `releasetool tag` to publish a release on Github. It will list the last few merged PRs.
Select the newly merged release PR. Releasetool will create the GitHub release with notes
extracted from the pull request and tag the new release.

15. Run `releasetool start` to bump the next snapshot version. Select "snapshot" when prompted for
13. Run `releasetool start` to bump the next snapshot version. Select "snapshot" when prompted for
the release type. This will bump the artifact versions and create a pull request.

16. Review and submit the PR.
14. Review and submit the PR.

Improvements
============
Expand Down
52 changes: 30 additions & 22 deletions google-api-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,21 @@
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -710,30 +725,9 @@
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>deploy</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -790,14 +784,14 @@
</reportSet>
</reportSets>
<configuration>
<aggregate>true</aggregate>
<show>protected</show>
<nohelp>true</nohelp>
<outputDirectory>${project.build.directory}/javadoc</outputDirectory>
</configuration>
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<id>release</id>
Expand Down Expand Up @@ -829,6 +823,20 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
29 changes: 15 additions & 14 deletions google-cloud-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1102,20 +1102,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>deploy</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
Expand Down Expand Up @@ -1171,11 +1157,26 @@
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
9 changes: 0 additions & 9 deletions google-cloud-clients/google-cloud-kms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-kms-v1</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-kms-v1</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
Expand Down Expand Up @@ -72,11 +68,6 @@
<artifactId>grpc-google-cloud-kms-v1</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-kms-v1</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-iam-v1</artifactId>
Expand Down
47 changes: 26 additions & 21 deletions google-cloud-clients/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,17 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
Expand Down Expand Up @@ -594,30 +605,9 @@
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>deploy</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
Expand Down Expand Up @@ -778,6 +768,7 @@
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<id>release</id>
Expand Down Expand Up @@ -814,6 +805,20 @@
</links>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
8 changes: 0 additions & 8 deletions google-cloud-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
Expand Down
8 changes: 0 additions & 8 deletions google-cloud-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
8 changes: 0 additions & 8 deletions google-cloud-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
29 changes: 17 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,29 @@
</licenses>
<modules>
<module>google-api-grpc</module>
<module>google-cloud-bom</module>
<module>google-cloud-clients</module>
<module>google-cloud-examples</module>
<module>google-cloud-testing</module>
<module>google-cloud-util</module>
<!-- For deployment reasons, a deployable artifact must be the last one. -->
<module>google-cloud-bom</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -102,17 +118,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 76e09ee

Please sign in to comment.