Skip to content

Commit e43b7be

Browse files
[XAPI-1130] Use OSSRH Staging API to publish now that OSSRH is EOL
1 parent 0be1ce3 commit e43b7be

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
env:
5353
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY}}
5454

55-
- name: Publish to Maven
55+
- name: Publish to OSSRH Staging API
5656
run: |
5757
export GPG_TTY=$(tty)
5858
mvn clean deploy -DskipTests=true
@@ -62,6 +62,18 @@ jobs:
6262
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
6363
working-directory: Xero-Java
6464

65+
# This needs to run from the same IP address that the mvn deploy ran on.
66+
# Once this is complete you will need to log in to https://central.sonatype.com/publishing
67+
# to finish the publish. We can supply publishing_type as 'automatic' instead to skip this step.
68+
# See docs: https://central.sonatype.org/publish/publish-portal-ossrh-staging-api
69+
- name: OSSRH Staging API publish
70+
run: |
71+
curl -i -X POST -u "$MAVEN_USERNAME:$MAVEN_PASSWORD" https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/com.github.xeroapi?publishing_type=user_managed
72+
env:
73+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
74+
MAVEN_PASSWORD: ${{ secrets.MAVEN_TOKEN }}
75+
working-directory: Xero-Java
76+
6577
notify-slack-on-success:
6678
runs-on: ubuntu-latest
6779
needs: publish

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<distributionManagement>
1818
<snapshotRepository>
1919
<id>ossrh</id>
20-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
20+
<url>https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots</url>
2121
</snapshotRepository>
2222
<repository>
2323
<id>ossrh</id>
24-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
24+
<url>https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/</url>
2525
</repository>
2626
</distributionManagement>
2727
<developers>
@@ -272,7 +272,7 @@
272272
<extensions>true</extensions>
273273
<configuration>
274274
<serverId>ossrh</serverId>
275-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
275+
<nexusUrl>https://ossrh-staging-api.central.sonatype.com/</nexusUrl>
276276
<autoReleaseAfterClose>true</autoReleaseAfterClose>
277277
</configuration>
278278
</plugin>

0 commit comments

Comments
 (0)