File tree Expand file tree Collapse file tree 3 files changed +36
-30
lines changed Expand file tree Collapse file tree 3 files changed +36
-30
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,18 @@ jobs:
37
37
- name : Set up Java and Maven
38
38
uses : actions/setup-java@v4
39
39
with :
40
- distribution : temurin
41
40
java-version : 17
41
+ distribution : temurin
42
42
cache : ' maven'
43
- - name : Release Maven package
44
- uses : samuelmeuli/action-maven-publish@v1
45
- with :
46
- maven_profiles : " release"
47
- gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
48
- gpg_passphrase : ${{ secrets.GPG_PASSPHRASE }}
49
- nexus_username : ${{ secrets.OSSRH_USERNAME }}
50
- nexus_password : ${{ secrets.OSSRH_TOKEN }}
43
+ server-id : central
44
+ server-username : MAVEN_USERNAME
45
+ server-password : MAVEN_CENTRAL_TOKEN
46
+ gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
47
+ gpg-passphrase : MAVEN_GPG_PASSPHRASE
48
+
49
+ - name : Publish to Apache Maven Central
50
+ run : mvn package deploy -Prelease
51
+ env :
52
+ MAVEN_USERNAME : ${{ secrets.NEXUS_USERNAME }}
53
+ MAVEN_CENTRAL_TOKEN : ${{ secrets.NEXUS_PASSWORD }}
54
+ MAVEN_GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
Original file line number Diff line number Diff line change @@ -15,19 +15,24 @@ jobs:
15
15
java-version : 17
16
16
distribution : temurin
17
17
cache : ' maven'
18
+ server-id : central
19
+ server-username : MAVEN_USERNAME
20
+ server-password : MAVEN_CENTRAL_TOKEN
21
+ gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
22
+ gpg-passphrase : MAVEN_GPG_PASSPHRASE
23
+
18
24
- name : change version to release version
19
25
# Assume that RELEASE_VERSION will have form like: "v1.0.1". So we cut the "v"
20
26
run : ./mvnw ${MAVEN_ARGS} versions:set -DnewVersion="${RELEASE_VERSION:1}" versions:commit
21
27
env :
22
28
RELEASE_VERSION : ${{ github.event.release.tag_name }}
23
- - name : Release Maven package
24
- uses : samuelmeuli/action-maven-publish@v1
25
- with :
26
- maven_profiles : " release"
27
- gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
28
- gpg_passphrase : ${{ secrets.GPG_PASSPHRASE }}
29
- nexus_username : ${{ secrets.OSSRH_USERNAME }}
30
- nexus_password : ${{ secrets.OSSRH_TOKEN }}
29
+
30
+ - name : Publish to Apache Maven Central
31
+ run : mvn package deploy -Prelease
32
+ env :
33
+ MAVEN_USERNAME : ${{ secrets.NEXUS_USERNAME }}
34
+ MAVEN_CENTRAL_TOKEN : ${{ secrets.NEXUS_PASSWORD }}
35
+ MAVEN_GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
31
36
32
37
# This is separate job because there were issues with git after release step, was not able to commit changes. See history.
33
38
update-working-version :
Original file line number Diff line number Diff line change 35
35
<url >https://github.com/java-operator-sdk/kubernetes-webhooks-framework/tree/master</url >
36
36
</scm >
37
37
38
- <distributionManagement >
39
- <snapshotRepository >
40
- <id >ossrh</id >
41
- <url >https://oss.sonatype.org/content/repositories/snapshots</url >
42
- </snapshotRepository >
43
- </distributionManagement >
44
-
45
38
<properties >
46
39
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
47
40
<java .version>17</java .version>
74
67
<maven-source-plugin .version>3.3.1</maven-source-plugin .version>
75
68
<spotless-maven-plugin .version>2.45.0</spotless-maven-plugin .version>
76
69
<spring-boot-dependencies .version>3.4.5</spring-boot-dependencies .version>
70
+ <central-publishing-maven-plugin .version>0.8.0</central-publishing-maven-plugin .version>
77
71
</properties >
78
72
79
73
<dependencyManagement >
343
337
<goals >
344
338
<goal >jar</goal >
345
339
</goals >
340
+ <phase >verify</phase >
346
341
</execution >
347
342
</executions >
348
343
</plugin >
366
361
</executions >
367
362
</plugin >
368
363
<plugin >
369
- <groupId >org.sonatype.plugins </groupId >
370
- <artifactId >nexus-staging -maven-plugin</artifactId >
371
- <version >${nexus-staging -maven-plugin.version} </version >
364
+ <groupId >org.sonatype.central </groupId >
365
+ <artifactId >central-publishing -maven-plugin</artifactId >
366
+ <version >${central-publishing -maven-plugin.version} </version >
372
367
<extensions >true</extensions >
373
368
<configuration >
374
- <serverId >ossrh</serverId >
375
- <nexusUrl >https://oss.sonatype.org/</nexusUrl >
376
- <autoReleaseAfterClose >true</autoReleaseAfterClose >
369
+ <publishingServerId >central</publishingServerId >
370
+ <tokenAuth >true</tokenAuth >
371
+ <autoPublish >true</autoPublish >
372
+ <waitUntil >published</waitUntil >
377
373
</configuration >
378
374
</plugin >
375
+
379
376
</plugins >
380
377
</build >
381
378
</profile >
You can’t perform that action at this time.
0 commit comments