Skip to content

Commit d718101

Browse files
committed
Update version to 1.7.0-beta-1 and modify Maven publishing workflow. Changed distribution management settings and updated plugin configurations for central publishing. Adjusted GitHub Actions to publish on push to specific branch.
1 parent 0cf7b8d commit d718101

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

.github/workflows/maven-publish.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Publish package to the Maven Central Repository
22

33
on:
4-
release:
5-
types:
6-
- created
4+
push:
5+
branches:
6+
- fix/DX-3251-release-workflow-fix
7+
# release:
8+
# types:
9+
# - created
710
jobs:
811
publish-maven:
912
runs-on: ubuntu-latest
@@ -17,16 +20,16 @@ jobs:
1720
with:
1821
java-version: "11"
1922
distribution: "adopt"
20-
server-id: ossrh
23+
server-id: central
2124
server-username: MAVEN_USERNAME
2225
server-password: MAVEN_PASSWORD
2326
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2427
gpg-passphrase: GPG_PASSPHRASE
2528
- name: Publish to the Maven Central Repository
2629
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
2730
env:
28-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
29-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
31+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
32+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
3033
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3134
publish-github:
3235
runs-on: ubuntu-latest

pom.xml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<artifactId>cms</artifactId>
88
<packaging>jar</packaging>
99
<name>contentstack-management-java</name>
10-
<version>1.7.0</version>
10+
<version>1.7.0-beta-1</version>
1111
<description>Contentstack Java Management SDK for Content Management API, Contentstack is a headless CMS with an
1212
API-first approach
1313
</description>
@@ -61,23 +61,23 @@
6161
</developer>
6262
</developers>
6363

64-
<distributionManagement>
64+
<!-- <distributionManagement>
6565
<snapshotRepository>
6666
<id>ossrh</id>
6767
<name>Apache Maven Packages Snapshot</name>
6868
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
6969
</snapshotRepository>
70-
<!-- <snapshotRepository>-->
71-
<!-- <id>github</id>-->
72-
<!-- <name>GitHub Apache Maven Packages</name>-->
73-
<!-- <url>https://maven.pkg.github.com/contentstack/contentstack-management-java</url>-->
74-
<!-- </snapshotRepository> -->
70+
<snapshotRepository>
71+
<id>github</id>
72+
<name>GitHub Apache Maven Packages</name>
73+
<url>https://maven.pkg.github.com/contentstack/contentstack-management-java</url>
74+
</snapshotRepository>
7575
<repository>
7676
<id>ossrh</id>
7777
<name>Apache Maven Packages Release</name>
7878
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
7979
</repository>
80-
</distributionManagement>
80+
</distributionManagement> -->
8181

8282
<properties>
8383
<sdk.version>1.0.0</sdk.version>
@@ -100,7 +100,6 @@
100100
<maven-site-plugin.version>3.3</maven-site-plugin.version>
101101
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
102102
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
103-
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
104103
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
105104
</properties>
106105

@@ -337,14 +336,14 @@
337336
</configuration>
338337
</plugin>
339338
<plugin>
340-
<groupId>org.sonatype.plugins</groupId>
341-
<artifactId>nexus-staging-maven-plugin</artifactId>
342-
<version>${nexus-staging-maven-plugin.version}</version>
339+
<groupId>org.sonatype.central</groupId>
340+
<artifactId>central-publishing-maven-plugin</artifactId>
341+
<version>0.8.0</version> <!-- or latest -->
343342
<extensions>true</extensions>
344343
<configuration>
345-
<serverId>ossrh</serverId>
346-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
347-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
344+
<publishingServerId>central</publishingServerId>
345+
<autoPublish>true</autoPublish>
346+
<waitUntil>published</waitUntil>
348347
</configuration>
349348
</plugin>
350349
<plugin>

0 commit comments

Comments
 (0)