Skip to content

Commit 76e09ee

Browse files
authored
Simplify release process (googleapis#3799)
* 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
1 parent a2f6a05 commit 76e09ee

9 files changed

Lines changed: 96 additions & 119 deletions

File tree

RELEASING.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -103,37 +103,28 @@ To push a release version
103103
assumes that there is no directory called `tmp_gh-pages` in the repository root. If it is
104104
present, remove it before running the script.
105105

106-
8. Locally edit the root `pom.xml` so that `mvn deploy` works:
107-
1. Under `<modules>`, comment out `google-cloud-examples`, `google-cloud-testing`, and
108-
`google-cloud-util`.
109-
2. Comment out the `nexus-staging-maven-plugin` plugin definition at the end of the file.
110-
111-
**Don't commit these changes.**
112-
113-
9. Check that you are not trying to release a SNAPSHOT build (the artifacts versions do not have
106+
8. Check that you are not trying to release a SNAPSHOT build (the artifacts versions do not have
114107
"-SNAPSHOT" suffix) and then run `mvn clean deploy -DskipTests=true --settings ~/.m2/settings.xml -P release`
115108
command. It will build and deploy artifacts to the staging repository.
116109

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

120-
10. Uncomment the `nexus-staging-maven-plugin` plugin definition from step 8; This plugin is
121-
needed to release the artifacts. Run `mvn nexus-staging:release` to release the artifacts.
122-
123-
11. Revert the local edits to your `pom.xml` performed a couple steps above by running `git checkout pom.xml`.
113+
9. Run `mvn nexus-staging:release` to release the artifacts. If you wish to abort the release, run
114+
`mvn nexus-staging:drop`.
124115

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

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

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

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

136-
16. Review and submit the PR.
127+
14. Review and submit the PR.
137128

138129
Improvements
139130
============

google-api-grpc/pom.xml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,21 @@
697697
</modules>
698698

699699
<build>
700+
<pluginManagement>
701+
<plugins>
702+
<plugin>
703+
<groupId>org.sonatype.plugins</groupId>
704+
<artifactId>nexus-staging-maven-plugin</artifactId>
705+
<version>1.6.6</version>
706+
<extensions>true</extensions>
707+
<configuration>
708+
<serverId>ossrh</serverId>
709+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
710+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
711+
</configuration>
712+
</plugin>
713+
</plugins>
714+
</pluginManagement>
700715
<plugins>
701716
<plugin>
702717
<artifactId>maven-compiler-plugin</artifactId>
@@ -710,30 +725,9 @@
710725
<showDeprecation>true</showDeprecation>
711726
</configuration>
712727
</plugin>
713-
<plugin>
714-
<groupId>org.apache.maven.plugins</groupId>
715-
<artifactId>maven-gpg-plugin</artifactId>
716-
<version>1.6</version>
717-
<executions>
718-
<execution>
719-
<id>sign-artifacts</id>
720-
<phase>deploy</phase>
721-
<goals>
722-
<goal>sign</goal>
723-
</goals>
724-
</execution>
725-
</executions>
726-
</plugin>
727728
<plugin>
728729
<groupId>org.sonatype.plugins</groupId>
729730
<artifactId>nexus-staging-maven-plugin</artifactId>
730-
<version>1.6.6</version>
731-
<extensions>true</extensions>
732-
<configuration>
733-
<serverId>sonatype-nexus-staging</serverId>
734-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
735-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
736-
</configuration>
737731
</plugin>
738732
<plugin>
739733
<groupId>org.apache.maven.plugins</groupId>
@@ -790,14 +784,14 @@
790784
</reportSet>
791785
</reportSets>
792786
<configuration>
793-
<aggregate>true</aggregate>
794787
<show>protected</show>
795788
<nohelp>true</nohelp>
796789
<outputDirectory>${project.build.directory}/javadoc</outputDirectory>
797790
</configuration>
798791
</plugin>
799792
</plugins>
800793
</reporting>
794+
801795
<profiles>
802796
<profile>
803797
<id>release</id>
@@ -829,6 +823,20 @@
829823
</execution>
830824
</executions>
831825
</plugin>
826+
<plugin>
827+
<groupId>org.apache.maven.plugins</groupId>
828+
<artifactId>maven-gpg-plugin</artifactId>
829+
<version>1.6</version>
830+
<executions>
831+
<execution>
832+
<id>sign-artifacts</id>
833+
<phase>verify</phase>
834+
<goals>
835+
<goal>sign</goal>
836+
</goals>
837+
</execution>
838+
</executions>
839+
</plugin>
832840
</plugins>
833841
</build>
834842
</profile>

google-cloud-bom/pom.xml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,20 +1102,6 @@
11021102

11031103
<build>
11041104
<plugins>
1105-
<plugin>
1106-
<groupId>org.apache.maven.plugins</groupId>
1107-
<artifactId>maven-gpg-plugin</artifactId>
1108-
<version>1.6</version>
1109-
<executions>
1110-
<execution>
1111-
<id>sign-artifacts</id>
1112-
<phase>deploy</phase>
1113-
<goals>
1114-
<goal>sign</goal>
1115-
</goals>
1116-
</execution>
1117-
</executions>
1118-
</plugin>
11191105
<plugin>
11201106
<groupId>org.sonatype.plugins</groupId>
11211107
<artifactId>nexus-staging-maven-plugin</artifactId>
@@ -1171,11 +1157,26 @@
11711157
</plugin>
11721158
</plugins>
11731159
</reporting>
1160+
11741161
<profiles>
11751162
<profile>
11761163
<id>release</id>
11771164
<build>
11781165
<plugins>
1166+
<plugin>
1167+
<groupId>org.apache.maven.plugins</groupId>
1168+
<artifactId>maven-gpg-plugin</artifactId>
1169+
<version>1.6</version>
1170+
<executions>
1171+
<execution>
1172+
<id>sign-artifacts</id>
1173+
<phase>verify</phase>
1174+
<goals>
1175+
<goal>sign</goal>
1176+
</goals>
1177+
</execution>
1178+
</executions>
1179+
</plugin>
11791180
<plugin>
11801181
<groupId>org.apache.maven.plugins</groupId>
11811182
<artifactId>maven-source-plugin</artifactId>

google-cloud-clients/google-cloud-kms/pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
<groupId>com.google.api.grpc</groupId>
3131
<artifactId>proto-google-cloud-kms-v1</artifactId>
3232
</dependency>
33-
<dependency>
34-
<groupId>com.google.api.grpc</groupId>
35-
<artifactId>proto-google-cloud-kms-v1</artifactId>
36-
</dependency>
3733
<dependency>
3834
<groupId>io.grpc</groupId>
3935
<artifactId>grpc-netty-shaded</artifactId>
@@ -72,11 +68,6 @@
7268
<artifactId>grpc-google-cloud-kms-v1</artifactId>
7369
<scope>test</scope>
7470
</dependency>
75-
<dependency>
76-
<groupId>com.google.api.grpc</groupId>
77-
<artifactId>grpc-google-cloud-kms-v1</artifactId>
78-
<scope>test</scope>
79-
</dependency>
8071
<dependency>
8172
<groupId>com.google.api.grpc</groupId>
8273
<artifactId>grpc-google-iam-v1</artifactId>

google-cloud-clients/pom.xml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,17 @@
464464
<build>
465465
<pluginManagement>
466466
<plugins>
467+
<plugin>
468+
<groupId>org.sonatype.plugins</groupId>
469+
<artifactId>nexus-staging-maven-plugin</artifactId>
470+
<version>1.6.6</version>
471+
<extensions>true</extensions>
472+
<configuration>
473+
<serverId>ossrh</serverId>
474+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
475+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
476+
</configuration>
477+
</plugin>
467478
<plugin>
468479
<groupId>org.codehaus.mojo</groupId>
469480
<artifactId>cobertura-maven-plugin</artifactId>
@@ -594,30 +605,9 @@
594605
<showDeprecation>true</showDeprecation>
595606
</configuration>
596607
</plugin>
597-
<plugin>
598-
<groupId>org.apache.maven.plugins</groupId>
599-
<artifactId>maven-gpg-plugin</artifactId>
600-
<version>1.6</version>
601-
<executions>
602-
<execution>
603-
<id>sign-artifacts</id>
604-
<phase>deploy</phase>
605-
<goals>
606-
<goal>sign</goal>
607-
</goals>
608-
</execution>
609-
</executions>
610-
</plugin>
611608
<plugin>
612609
<groupId>org.sonatype.plugins</groupId>
613610
<artifactId>nexus-staging-maven-plugin</artifactId>
614-
<version>1.6.6</version>
615-
<extensions>true</extensions>
616-
<configuration>
617-
<serverId>sonatype-nexus-staging</serverId>
618-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
619-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
620-
</configuration>
621611
</plugin>
622612
<plugin>
623613
<groupId>org.eluder.coveralls</groupId>
@@ -778,6 +768,7 @@
778768
</plugin>
779769
</plugins>
780770
</reporting>
771+
781772
<profiles>
782773
<profile>
783774
<id>release</id>
@@ -814,6 +805,20 @@
814805
</links>
815806
</configuration>
816807
</plugin>
808+
<plugin>
809+
<groupId>org.apache.maven.plugins</groupId>
810+
<artifactId>maven-gpg-plugin</artifactId>
811+
<version>1.6</version>
812+
<executions>
813+
<execution>
814+
<id>sign-artifacts</id>
815+
<phase>verify</phase>
816+
<goals>
817+
<goal>sign</goal>
818+
</goals>
819+
</execution>
820+
</executions>
821+
</plugin>
817822
</plugins>
818823
</build>
819824
</profile>

google-cloud-examples/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,6 @@
201201
<skip>true</skip>
202202
</configuration>
203203
</plugin>
204-
<plugin>
205-
<groupId>org.sonatype.plugins</groupId>
206-
<artifactId>nexus-staging-maven-plugin</artifactId>
207-
<version>1.6.6</version>
208-
<configuration>
209-
<skip>true</skip>
210-
</configuration>
211-
</plugin>
212204
</plugins>
213205
</build>
214206
<profiles>

google-cloud-testing/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,6 @@
109109
<skip>true</skip>
110110
</configuration>
111111
</plugin>
112-
<plugin>
113-
<groupId>org.sonatype.plugins</groupId>
114-
<artifactId>nexus-staging-maven-plugin</artifactId>
115-
<version>1.6.6</version>
116-
<configuration>
117-
<skip>true</skip>
118-
</configuration>
119-
</plugin>
120112
</plugins>
121113
</build>
122114
</project>

google-cloud-util/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@
3131
<skip>true</skip>
3232
</configuration>
3333
</plugin>
34-
<plugin>
35-
<groupId>org.sonatype.plugins</groupId>
36-
<artifactId>nexus-staging-maven-plugin</artifactId>
37-
<version>1.6.6</version>
38-
<configuration>
39-
<skip>true</skip>
40-
</configuration>
41-
</plugin>
4234
</plugins>
4335
</build>
4436
</project>

pom.xml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,29 @@
7878
</licenses>
7979
<modules>
8080
<module>google-api-grpc</module>
81-
<module>google-cloud-bom</module>
8281
<module>google-cloud-clients</module>
8382
<module>google-cloud-examples</module>
8483
<module>google-cloud-testing</module>
8584
<module>google-cloud-util</module>
85+
<!-- For deployment reasons, a deployable artifact must be the last one. -->
86+
<module>google-cloud-bom</module>
8687
</modules>
8788
<build>
89+
<pluginManagement>
90+
<plugins>
91+
<plugin>
92+
<groupId>org.sonatype.plugins</groupId>
93+
<artifactId>nexus-staging-maven-plugin</artifactId>
94+
<version>1.6.6</version>
95+
<extensions>true</extensions>
96+
<configuration>
97+
<serverId>ossrh</serverId>
98+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
99+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
100+
</configuration>
101+
</plugin>
102+
</plugins>
103+
</pluginManagement>
88104
<plugins>
89105
<plugin>
90106
<groupId>org.apache.maven.plugins</groupId>
@@ -102,17 +118,6 @@
102118
<skip>true</skip>
103119
</configuration>
104120
</plugin>
105-
<plugin>
106-
<groupId>org.sonatype.plugins</groupId>
107-
<artifactId>nexus-staging-maven-plugin</artifactId>
108-
<version>1.6.6</version>
109-
<configuration>
110-
<serverId>sonatype-nexus-staging</serverId>
111-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
112-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
113-
<skip>true</skip>
114-
</configuration>
115-
</plugin>
116121
</plugins>
117122
</build>
118123
</project>

0 commit comments

Comments
 (0)