Skip to content

Commit 3838373

Browse files
authored
update workflow and pom to push to maven central repo (#17)
1 parent 7bcd1cf commit 3838373

File tree

4 files changed

+43
-40
lines changed

4 files changed

+43
-40
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ jobs:
2424
java-version: '11'
2525
distribution: 'adopt'
2626
cache: 'maven'
27-
server-id: ossrh
27+
server-id: central
2828
server-username: MAVEN_USERNAME
2929
server-password: MAVEN_PASSWORD
30+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
3031

3132
- name: Check linting
3233
run: mvn checkstyle:check
@@ -38,20 +39,17 @@ jobs:
3839
run: .ci/scripts/check-project-version.sh
3940

4041
- name: Install gpg key
41-
run: |
42-
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | base64 --decode | gpg --batch --import
42+
run: echo -e "${{ secrets.GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
4343

4444
- name: Maven deploy
45-
run: |
46-
mvn --no-transfer-progress --batch-mode \
47-
-Dgpg.passphrase='${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}' \
48-
-DskipTests deploy -P release
45+
run: mvn --no-transfer-progress --batch-mode -DskipTests deploy -P release
4946
env:
50-
MAVEN_USERNAME: ${{ secrets.D11_NEXUS_USERNAME }}
51-
MAVEN_PASSWORD: ${{ secrets.D11_NEXUS_PASSWORD }}
47+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
48+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
49+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASS_PHRASE }}
5250

5351
- name: Upload to codecov
5452
uses: codecov/[email protected]
5553
with:
5654
file: ./target/site/jacoco/jacoco.xml
57-
fail_ci_if_error: true
55+
fail_ci_if_error: false

.github/workflows/release.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,23 @@ jobs:
3535
java-version: '11'
3636
distribution: 'adopt'
3737
cache: 'maven'
38-
server-id: ossrh
38+
server-id: central
3939
server-username: MAVEN_USERNAME
4040
server-password: MAVEN_PASSWORD
41+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4142

4243
- name: Update version pom.xml
4344
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
4445

4546
- name: Install gpg key
46-
run: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | base64 --decode | gpg --batch --import
47+
run: echo -e "${{ secrets.GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
4748

4849
- name: Publish
49-
run: |
50-
mvn --no-transfer-progress --batch-mode \
51-
-Dgpg.passphrase='${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}' \
52-
deploy -P release
50+
run: mvn --no-transfer-progress --batch-mode deploy -P release
5351
env:
54-
MAVEN_USERNAME: ${{ secrets.D11_NEXUS_USERNAME }}
55-
MAVEN_PASSWORD: ${{ secrets.D11_NEXUS_PASSWORD }}
52+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
53+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
54+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASS_PHRASE }}
5655

5756
- name: Bump version
5857
run: .ci/scripts/bump-version.sh

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# vertx-rest
2-
[![Continuous Integration](https://github.com/dream11/vertx-rest/actions/workflows/ci.yml/badge.svg)](https://github.com/dream11/vertx-rest/actions/workflows/ci.yml)
3-
[![Code Coverage](https://codecov.io/gh/dream11/vertx-rest/branch/master/graph/badge.svg)](https://codecov.io/gh/dream11/vertx-rest)
4-
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://raw.githubusercontent.com/dream11/vertx-rest/master/LICENSE)
2+
[![Continuous Integration](https://github.com/dream-horizon-org/vertx-rest/actions/workflows/ci.yml/badge.svg)](https://github.com/dream-horizon-org/vertx-rest/actions/workflows/ci.yml)
3+
[![Code Coverage](https://codecov.io/gh/dream-horizon-org/vertx-rest/branch/master/graph/badge.svg)](https://codecov.io/gh/dream-horizon-org/vertx-rest)
4+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://raw.githubusercontent.com/dream-horizon-org/vertx-rest/master/LICENSE)
55

66
- [Overview](#overview)
77
- [Setup](#setup)
@@ -45,7 +45,7 @@ Add the following dependency to the `dependencies` section of your build descrip
4545
}
4646
```
4747

48-
Note: Replace `x.y.z` above with one of the [released versions](https://github.com/dream11/vertx-rest/releases)
48+
Note: Replace `x.y.z` above with one of the [released versions](https://github.com/dream-horizon-org/vertx-rest/releases)
4949

5050
## Usage
5151

pom.xml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99

1010
<name>${project.groupId}:${project.artifactId}</name>
1111
<description>Vertx library for writing rest application based on JAX-RS annotations</description>
12-
<url>https://github.com/dream11/vertx-rest</url>
12+
<url>https://github.com/dream-horizon-org/vertx-rest</url>
1313

1414
<scm>
15-
<developerConnection>scm:git:https://github.com/dream11/vertx-rest.git</developerConnection>
16-
<connection>scm:git:https://github.com/dream11/vertx-rest.git</connection>
17-
<url>https://github.com/dream11/vertx-rest</url>
15+
<developerConnection>scm:git:https://github.com/dream-horizon-org/vertx-rest.git</developerConnection>
16+
<connection>scm:git:https://github.com/dream-horizon-org/vertx-rest.git</connection>
17+
<url>https://github.com/dream-horizon-org/vertx-rest</url>
1818
<tag>HEAD</tag>
1919
</scm>
2020

2121
<licenses>
2222
<license>
2323
<name>MIT License</name>
24-
<url>https://github.com/dream11/vertx-rest/raw/master/LICENSE</url>
24+
<url>https://github.com/dream-horizon-org/vertx-rest/raw/master/LICENSE</url>
2525
</license>
2626
</licenses>
2727

@@ -36,14 +36,21 @@
3636

3737
<distributionManagement>
3838
<snapshotRepository>
39-
<id>ossrh</id>
40-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
39+
<id>central</id>
40+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
4141
</snapshotRepository>
42+
</distributionManagement>
43+
44+
<repositories>
4245
<repository>
43-
<id>ossrh</id>
44-
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
46+
<name>Central Portal Snapshots</name>
47+
<id>central-portal-snapshots</id>
48+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
49+
<snapshots>
50+
<enabled>true</enabled>
51+
</snapshots>
4552
</repository>
46-
</distributionManagement>
53+
</repositories>
4754

4855
<properties>
4956
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -77,8 +84,8 @@
7784
<maven.failsafe.plugin.version>3.0.0-M5</maven.failsafe.plugin.version>
7885
<maven.jacoco.plugin.version>0.8.8</maven.jacoco.plugin.version>
7986
<maven.source.plugin.version>3.2.1</maven.source.plugin.version>
80-
<maven.gpg.plugin.version>3.0.1</maven.gpg.plugin.version>
81-
<maven.nexus.plugin.version>1.6.13</maven.nexus.plugin.version>
87+
<maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
88+
<central.publishing.plugin.version>0.8.0</central.publishing.plugin.version>
8289
<maven.checkstyle.plugin.version>3.2.0</maven.checkstyle.plugin.version>
8390
<maven.swagger.plugin.jakarta.version>2.2.6</maven.swagger.plugin.jakarta.version>
8491
<maven.dependency.plugin.version>3.1.2</maven.dependency.plugin.version>
@@ -401,14 +408,13 @@
401408
</plugin>
402409

403410
<plugin>
404-
<groupId>org.sonatype.plugins</groupId>
405-
<artifactId>nexus-staging-maven-plugin</artifactId>
406-
<version>${maven.nexus.plugin.version}</version>
411+
<groupId>org.sonatype.central</groupId>
412+
<artifactId>central-publishing-maven-plugin</artifactId>
413+
<version>${central.publishing.plugin.version}</version>
407414
<extensions>true</extensions>
408415
<configuration>
409-
<serverId>ossrh</serverId>
410-
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
411-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
416+
<publishingServerId>central</publishingServerId>
417+
<autoPublish>true</autoPublish>
412418
</configuration>
413419
</plugin>
414420

0 commit comments

Comments
 (0)