Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: profile to upload to GCP Artifact Registry #1132

Merged
merged 5 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 51 additions & 11 deletions google-oauth-client-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
Expand Down Expand Up @@ -134,6 +123,57 @@
</build>

<profiles>
<!-- Because the BOM artifact does not need to inherit other properties such as dependencies
in the root pom.xml, this needs to define publication-related profiles. -->
<profile>
<!-- By default, we release artifacts to Sonatype, which requires
nexus-staging-maven-plugin. -->
<id>release-sonatype</id>
<activation>
<property>
<!-- Only when we use the release-gcp-artifact-registry profile,
which comes with artifact-registry-url property, this profile is
turned off. -->
<name>!artifact-registry-url</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
this release-gcp-artifact-registry profile:
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
-->
<id>release-gcp-artifact-registry</id>
<properties>
<artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</artifact-registry-url>
</properties>
<distributionManagement>
<repository>
<id>gcp-artifact-registry-repository</id>
<url>${artifact-registry-url}</url>
</repository>
<snapshotRepository>
<id>gcp-artifact-registry-repository</id>
<url>${artifact-registry-url}</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>release-sign-artifacts</id>
<activation>
Expand Down
47 changes: 42 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
Expand Down Expand Up @@ -517,7 +513,6 @@
</plugins>
</build>
</profile>

<profile>
<id>docFX</id>
<activation>
Expand Down Expand Up @@ -578,5 +573,47 @@
</plugins>
</build>
</profile>
<profile>
<!-- By default, we release artifacts to Sonatype, which requires
nexus-staging-maven-plugin. -->
<id>release-sonatype</id>
<activation>
<property>
<!-- Only when we use the release-gcp-artifact-registry profile,
which comes with artifact-registry-url property, this profile is
turned off. -->
<name>!artifact-registry-url</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- Optionally, we can publish the artifacts to GCP Artifact Registry specifying
this release-gcp-artifact-registry profile:
mvn deploy -P=release-gcp-artifact-registry -P=-release-sonatype \
-Dartifact-registry-url=artifactregistry://us-maven.pkg.dev/...
-->
<id>release-gcp-artifact-registry</id>
<properties>
<artifact-registry-url>artifactregistry://please-define-artifact-registry-url-property</artifact-registry-url>
</properties>
<distributionManagement>
<repository>
<id>gcp-artifact-registry-repository</id>
<url>${artifact-registry-url}</url>
</repository>
<snapshotRepository>
<id>gcp-artifact-registry-repository</id>
<url>${artifact-registry-url}</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
</project>
Loading