Skip to content

Commit

Permalink
ci: Maven profile for Artifact Registry release (#936)
Browse files Browse the repository at this point in the history
* ci: profile for Artifact Registry release
  • Loading branch information
suztomo authored Nov 26, 2024
1 parent 438693d commit 7a8e4f8
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 35 deletions.
12 changes: 0 additions & 12 deletions java-shared-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -381,18 +381,6 @@
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<!--
Enables the "artifactregistry://" URL scheme (go/airlock/howto_maven).
Note that Maven extensions cannot be included in profiles (
https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms)
-->
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.3</version>
</extension>
</extensions>
</build>

<reporting>
Expand Down
92 changes: 69 additions & 23 deletions native-image-shared-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,32 +81,78 @@
</dependency>
</dependencies>
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
</plugin>
</plugins>
<extensions>
<extension>
<!--
Enables the "artifactregistry://" URL scheme in Artifact Registry (Airlock and ExitGate).
Note that Maven extensions cannot be included in profiles (
https://maven.apache.org/guides/introduction/introduction-to-profiles.html#profiles-in-poms)
-->
<groupId>com.google.cloud.artifactregistry</groupId>
<artifactId>artifactregistry-maven-wagon</artifactId>
<version>2.2.3</version>
</extension>
</extensions>
</build>
<profiles>
<profile>
<!-- By default, we release artifacts to Sonatype, which requires
nexus-staging-maven-plugin. -->
<id>release-sonatype</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<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>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<artifact-registry-url>artifactregistry://undefined-artifact-registry-url-value</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</id>
<activation>
Expand Down

0 comments on commit 7a8e4f8

Please sign in to comment.