Skip to content

Commit f03aff7

Browse files
committed
feat(ci): publish 6.x snapshots to Maven Central
Signed-off-by: Marc Nuri <[email protected]>
1 parent 2f090aa commit f03aff7

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

.github/workflows/release-snapshots.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ on:
2929
env:
3030
MAVEN_ARGS: -B -C -V -ntp -Dhttp.keepAlive=false -e ${{ github.event.inputs.additional_args }}
3131
RELEASE_MAVEN_ARGS: -Prelease -Denforcer.skip=true
32-
OSSRHUSERNAME: ${{ secrets.OSSRHUSERNAME }}
33-
OSSRHPASSWORD: ${{ secrets.OSSRHPASSWORD }}
32+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
33+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
3434
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }}
3535

3636
#permissions:
@@ -56,9 +56,9 @@ jobs:
5656
with:
5757
java-version: 8
5858
distribution: temurin
59-
server-id: ossrh
60-
server-username: OSSRHUSERNAME
61-
server-password: OSSRHPASSWORD
59+
server-id: central-portal
60+
server-username: MAVEN_CENTRAL_USERNAME
61+
server-password: MAVEN_CENTRAL_PASSWORD
6262
gpg-private-key: ${{ secrets.SIGNINGKEY }}
6363
gpg-passphrase: SIGNINGPASSWORD
6464
- name: Build and release Java 8 modules
@@ -83,9 +83,9 @@ jobs:
8383
with:
8484
java-version: 11
8585
distribution: temurin
86-
server-id: ossrh
87-
server-username: OSSRHUSERNAME
88-
server-password: OSSRHPASSWORD
86+
server-id: central-portal
87+
server-username: MAVEN_CENTRAL_USERNAME
88+
server-password: MAVEN_CENTRAL_PASSWORD
8989
gpg-private-key: ${{ secrets.SIGNINGKEY }}
9090
gpg-passphrase: SIGNINGPASSWORD
9191
- name: Build and release Java 11 modules
@@ -100,5 +100,5 @@ jobs:
100100
- name: Build and release BOM
101101
run: |
102102
./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} clean sundr:generate-bom &&
103-
./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} gpg:sign-and-deploy-file -Prelease -Dgpg.passphrase=${{ secrets.SIGNINGPASSWORD }} -DrepositoryId=ossrh -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DpomFile="target/classes/kubernetes-client-bom/pom.xml" -Dfile="target/classes/kubernetes-client-bom/pom.xml" &&
104-
./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} gpg:sign-and-deploy-file -Prelease -Dgpg.passphrase=${{ secrets.SIGNINGPASSWORD }} -DrepositoryId=ossrh -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DpomFile="target/classes/kubernetes-client-bom-with-deps/pom.xml" -Dfile="target/classes/kubernetes-client-bom-with-deps/pom.xml"
103+
./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} gpg:sign-and-deploy-file -Prelease -Dgpg.passphrase=${{ secrets.SIGNINGPASSWORD }} -DrepositoryId=ossrh -Durl=https://central.sonatype.com/repository/maven-snapshots/ -DpomFile="target/classes/kubernetes-client-bom/pom.xml" -Dfile="target/classes/kubernetes-client-bom/pom.xml" &&
104+
./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} gpg:sign-and-deploy-file -Prelease -Dgpg.passphrase=${{ secrets.SIGNINGPASSWORD }} -DrepositoryId=ossrh -Durl=https://central.sonatype.com/repository/maven-snapshots/ -DpomFile="target/classes/kubernetes-client-bom-with-deps/pom.xml" -Dfile="target/classes/kubernetes-client-bom-with-deps/pom.xml"

pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464

6565
<distributionManagement>
6666
<snapshotRepository>
67-
<id>ossrh</id>
68-
<name>Sonatype OSS Repository (Snapshots)</name>
69-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
67+
<id>central-portal</id>
68+
<name>Central Portal (Snapshots)</name>
69+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
7070
</snapshotRepository>
7171
<repository>
7272
<id>ossrh</id>
@@ -169,7 +169,7 @@
169169
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
170170
<jkube.version>1.16.2</jkube.version>
171171
<sonar-maven-plugin.version>3.11.0.3922</sonar-maven-plugin.version>
172-
<nexus-staging-maven-plugin>1.7.0</nexus-staging-maven-plugin>
172+
<central-publishing-maven-plugin>0.7.0</central-publishing-maven-plugin>
173173
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
174174

175175
<!-- Other options -->
@@ -1343,14 +1343,14 @@
13431343
</configuration>
13441344
</plugin>
13451345
<plugin>
1346-
<groupId>org.sonatype.plugins</groupId>
1347-
<artifactId>nexus-staging-maven-plugin</artifactId>
1348-
<version>${nexus-staging-maven-plugin}</version>
1346+
<groupId>org.sonatype.central</groupId>
1347+
<artifactId>central-publishing-maven-plugin</artifactId>
1348+
<version>${central-publishing-maven-plugin}</version>
13491349
<extensions>true</extensions>
13501350
<configuration>
1351+
<publishingServerId>central-portal</publishingServerId>
1352+
<autoPublish>false</autoPublish>
13511353
<serverId>ossrh</serverId>
1352-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
1353-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
13541354
</configuration>
13551355
</plugin>
13561356
<plugin>

0 commit comments

Comments
 (0)