File tree Expand file tree Collapse file tree 3 files changed +35
-30
lines changed Expand file tree Collapse file tree 3 files changed +35
-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,25 @@ 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 }}
36
+
31
37
32
38
# This is separate job because there were issues with git after release step, was not able to commit changes. See history.
33
39
update-working-version :
Original file line number Diff line number Diff line change 44
44
<url >https://github.com/java-operator-sdk/operator-framework-spring-boot-starter.git/tree/master</url >
45
45
</scm >
46
46
47
- <distributionManagement >
48
- <snapshotRepository >
49
- <id >ossrh</id >
50
- <url >https://oss.sonatype.org/content/repositories/snapshots</url >
51
- </snapshotRepository >
52
- </distributionManagement >
53
-
54
47
<properties >
55
48
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
56
49
<java .version>17</java .version>
67
60
<maven-javadoc-plugin .version>3.11.2</maven-javadoc-plugin .version>
68
61
<maven-gpg-plugin .version>3.2.8</maven-gpg-plugin .version>
69
62
<maven-source-plugin .version>3.3.1</maven-source-plugin .version>
63
+ <central-publishing-maven-plugin .version>0.8.0</central-publishing-maven-plugin .version>
70
64
</properties >
71
65
72
66
<dependencyManagement >
238
232
</executions >
239
233
</plugin >
240
234
<plugin >
241
- <groupId >org.sonatype.plugins </groupId >
242
- <artifactId >nexus-staging -maven-plugin</artifactId >
243
- <version >${nexus-staging -maven-plugin.version} </version >
235
+ <groupId >org.sonatype.central </groupId >
236
+ <artifactId >central-publishing -maven-plugin</artifactId >
237
+ <version >${central-publishing -maven-plugin.version} </version >
244
238
<extensions >true</extensions >
245
239
<configuration >
246
- <serverId >ossrh</serverId >
247
- <nexusUrl >https://oss.sonatype.org/</nexusUrl >
248
- <autoReleaseAfterClose >true</autoReleaseAfterClose >
240
+ <publishingServerId >central</publishingServerId >
241
+ <tokenAuth >true</tokenAuth >
242
+ <autoPublish >true</autoPublish >
243
+ <waitUntil >published</waitUntil >
249
244
</configuration >
250
245
</plugin >
251
246
</plugins >
You can’t perform that action at this time.
0 commit comments