Skip to content

Commit fdd901f

Browse files
committed
testing release workflow
1 parent 518128f commit fdd901f

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

.github/workflows/maven-publish.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Publish package to the Maven Central Repository
22
on:
3+
push:
4+
branches:
5+
- fix/DX-3277-update-release-workflow
36
release:
47
types: [created]
58
jobs:
@@ -15,16 +18,16 @@ jobs:
1518
with:
1619
java-version: '17'
1720
distribution: 'adopt'
18-
server-id: ossrh
21+
server-id: central
1922
server-username: MAVEN_USERNAME
2023
server-password: MAVEN_PASSWORD
2124
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2225
gpg-passphrase: GPG_PASSPHRASE
23-
- name: Publish package
26+
- name: Publish to the Maven Central Repository
2427
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
2528
env:
26-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
27-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
29+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
30+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
2831
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
2932
publish-github:
3033
runs-on: ubuntu-latest
@@ -38,15 +41,15 @@ jobs:
3841
server-id: github
3942
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
4043
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
41-
- name: Set up Maven settings for OSSRH
44+
- name: Set up Maven settings for Central and GitHub
4245
run: |
4346
mkdir -p $HOME/.m2
4447
echo "<settings>
4548
<servers>
4649
<server>
47-
<id>ossrh</id>
48-
<username>${{ secrets.OSSRH_USERNAME }}</username>
49-
<password>${{ secrets.OSSRH_PASSWORD }}</password>
50+
<id>central</id>
51+
<username>${{ secrets.MAVEN_USERNAME }}</username>
52+
<password>${{ secrets.MAVEN_PASSWORD }}</password>
5053
</server>
5154
<server>
5255
<id>github</id>

pom.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.contentstack.sdk</groupId>
66
<artifactId>utils</artifactId>
7-
<version>1.2.15</version>
7+
<version>1.2.16-beta</version>
88
<packaging>jar</packaging>
99
<name>Contentstack-utils</name>
1010
<description>Java Utils SDK for Contentstack Content Delivery API, Contentstack is a headless CMS</description>
@@ -24,7 +24,7 @@
2424
<json.simple.version>1.1.1</json.simple.version>
2525
<maven-site-plugin.version>3.3</maven-site-plugin.version>
2626
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
27-
<nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
27+
<central-publishing-maven-plugin.version>1.0.0</central-publishing-maven-plugin.version>
2828
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
2929
<validation-version>2.0.1.Final</validation-version>
3030
<json-version>20250107</json-version>
@@ -41,6 +41,8 @@
4141
</developer>
4242
</developers>
4343

44+
<!-- Old OSSRH configuration - no longer needed with central-publishing-maven-plugin -->
45+
<!--
4446
<distributionManagement>
4547
<snapshotRepository>
4648
<id>ossrh</id>
@@ -51,6 +53,7 @@
5153
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
5254
</repository>
5355
</distributionManagement>
56+
-->
5457

5558
<scm>
5659
<url>https://github.com/contentstack/contentstack-utils-java</url>
@@ -228,6 +231,8 @@
228231
</execution>
229232
</executions>
230233
</plugin>
234+
<!-- Old nexus-staging-maven-plugin - no longer supported -->
235+
<!--
231236
<plugin>
232237
<groupId>org.sonatype.plugins</groupId>
233238
<artifactId>nexus-staging-maven-plugin</artifactId>
@@ -239,6 +244,19 @@
239244
<autoReleaseAfterClose>true</autoReleaseAfterClose>
240245
</configuration>
241246
</plugin>
247+
-->
248+
<!-- New Central Publishing Plugin for Maven Central -->
249+
<plugin>
250+
<groupId>org.sonatype.central</groupId>
251+
<artifactId>central-publishing-maven-plugin</artifactId>
252+
<version>${central-publishing-maven-plugin.version}</version>
253+
<extensions>true</extensions>
254+
<configuration>
255+
<publishingServerId>central</publishingServerId>
256+
<autoPublish>true</autoPublish>
257+
<waitUntil>published</waitUntil>
258+
</configuration>
259+
</plugin>
242260
<plugin>
243261
<groupId>org.apache.maven.plugins</groupId>
244262
<artifactId>maven-compiler-plugin</artifactId>

0 commit comments

Comments
 (0)