Skip to content

Commit aa3de11

Browse files
committed
chore: update release configuration for Maven Central publishing
1 parent 14ff764 commit aa3de11

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313
- name: Set up Maven Central Repository
14-
uses: actions/setup-java@v2
14+
uses: actions/setup-java@v3
1515
with:
1616
java-version: '17'
17-
distribution: 'adopt'
18-
server-id: ossrh
19-
server-username: MAVEN_USERNAME
20-
server-password: MAVEN_PASSWORD
17+
distribution: 'temurin'
18+
cache: maven
19+
server-id: central
20+
server-username: OSSRH_USERNAME
21+
server-password: OSSRH_TOKEN
2122
- id: install-secret-key
2223
name: Install gpg secret key
2324
run: |
2425
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
2526
gpg --list-secret-keys --keyid-format LONG
2627
- name: Publish package
2728
env:
28-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
29-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
30-
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -P release clean deploy
29+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
30+
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
31+
run: mvn --batch-mode --errors -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -P release clean deploy

pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,26 +275,26 @@
275275
</configuration>
276276
</plugin>
277277
<plugin>
278-
<groupId>org.sonatype.plugins</groupId>
279-
<artifactId>nexus-staging-maven-plugin</artifactId>
280-
<version>1.7.0</version>
278+
<groupId>org.sonatype.central</groupId>
279+
<artifactId>central-publishing-maven-plugin</artifactId>
280+
<version>0.4.0</version>
281281
<extensions>true</extensions>
282282
<configuration>
283-
<serverId>ossrh</serverId>
284-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
285-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
283+
<publishingServerId>central</publishingServerId>
284+
<tokenAuth>true</tokenAuth>
285+
<autoPublish>true</autoPublish>
286286
</configuration>
287287
</plugin>
288288
</plugins>
289289
</build>
290290
<distributionManagement>
291291
<snapshotRepository>
292-
<id>ossrh</id>
293-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
292+
<id>central</id>
293+
<url>https://central.sonatype.com/api/v1/publisher/upload</url>
294294
</snapshotRepository>
295295
<repository>
296-
<id>ossrh</id>
297-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
296+
<id>central</id>
297+
<url>https://central.sonatype.com/api/v1/publisher/upload</url>
298298
</repository>
299299
</distributionManagement>
300300
</profile>

0 commit comments

Comments
 (0)