diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9d3156df..a3e2715c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -52,7 +52,7 @@ jobs: env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY}} - - name: Publish to Maven + - name: Publish to OSSRH Staging API run: | export GPG_TTY=$(tty) mvn clean deploy -DskipTests=true @@ -62,6 +62,18 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} working-directory: Xero-Java + # This needs to run from the same IP address that the mvn deploy ran on. + # Once this is complete you will need to log in to https://central.sonatype.com/publishing + # to finish the publish. We can supply publishing_type as 'automatic' instead to skip this step. + # See docs: https://central.sonatype.org/publish/publish-portal-ossrh-staging-api + - name: OSSRH Staging API publish + run: | + 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 + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_TOKEN }} + working-directory: Xero-Java + notify-slack-on-success: runs-on: ubuntu-latest needs: publish diff --git a/pom.xml b/pom.xml index 248453f3..74641bd9 100644 --- a/pom.xml +++ b/pom.xml @@ -17,11 +17,11 @@ ossrh - https://oss.sonatype.org/content/repositories/snapshots + https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/ @@ -272,7 +272,7 @@ true ossrh - https://oss.sonatype.org/ + https://ossrh-staging-api.central.sonatype.com/ true