Skip to content

Commit 6ab7b39

Browse files
authored
feat: fix pom.xml to fix CI for publishing to https://central.sonatype.com (#12)
* feat: fix pom.xml to fix CI for publishing to https://central.sonatype.com * fix: upgrade node.js version in CI from 18 to 20
1 parent c592afe commit 6ab7b39

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

.github/workflows/ci.yml

+23
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,32 @@ jobs:
2525
java-version: '8'
2626
distribution: 'zulu'
2727
cache: 'maven'
28+
server-id: ossrh
29+
server-username: OSSRH_JIRA_USERNAME
30+
server-password: OSSRH_JIRA_PASSWORD
31+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
32+
gpg-passphrase: GPG_PASSPHRASE
2833

2934
- name: Build with Maven
3035
run: mvn clean test jacoco:report
3136

3237
- name: Upload To Codecov
3338
uses: codecov/codecov-action@v1
39+
with:
40+
token: ${{ secrets.CODECOV_TOKEN }}
41+
42+
- name: Set up Node.js
43+
uses: actions/setup-node@v2
44+
with:
45+
node-version: 20
46+
47+
- name: Semantic Release
48+
run: |
49+
npm install -g @conveyal/maven-semantic-release semantic-release
50+
semantic-release --prepare @conveyal/maven-semantic-release --publish @semantic-release/github,@conveyal/maven-semantic-release --verify-conditions @semantic-release/github,@conveyal/maven-semantic-release --verify-release @conveyal/maven-semantic-release
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
54+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
55+
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
56+
OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}

pom.xml

+15-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<licenses>
2828
<license>
2929
<name>The Apache Software License, Version 2.0</name>
30-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
30+
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
3131
<distribution>repo</distribution>
3232
</license>
3333
</licenses>
@@ -58,6 +58,19 @@
5858
</activation>
5959
<build>
6060
<plugins>
61+
<plugin>
62+
<!-- Automatically close and deploy from OSSRH -->
63+
<groupId>org.sonatype.central</groupId>
64+
<artifactId>central-publishing-maven-plugin</artifactId>
65+
<version>0.5.0</version>
66+
<extensions>true</extensions>
67+
<configuration>
68+
<publishingServerId>ossrh</publishingServerId>
69+
<tokenAuth>true</tokenAuth>
70+
<!-- Release versions will be synced to Maven Central automatically. -->
71+
<autoPublish>true</autoPublish>
72+
</configuration>
73+
</plugin>
6174
<plugin>
6275
<groupId>org.apache.maven.plugins</groupId>
6376
<artifactId>maven-source-plugin</artifactId>
@@ -126,12 +139,8 @@
126139
<distributionManagement>
127140
<snapshotRepository>
128141
<id>ossrh</id>
129-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
142+
<url>https://central.sonatype.com</url>
130143
</snapshotRepository>
131-
<repository>
132-
<id>ossrh</id>
133-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
134-
</repository>
135144
</distributionManagement>
136145
</profile>
137146
</profiles>

0 commit comments

Comments
 (0)