diff --git a/.github/workflows/maven-ci-build.yml b/.github/workflows/maven-ci-build.yml index 9fa40617..bda5c294 100644 --- a/.github/workflows/maven-ci-build.yml +++ b/.github/workflows/maven-ci-build.yml @@ -15,6 +15,9 @@ jobs: distribution: adopt java-version: '21' cache: maven + server-id: central + server-username: MAVEN_CENTRAL_USER + server-password: MAVEN_CENTRAL_TOKEN - name: Login to registry.redhat.io uses: docker/login-action@v3.7.0 with: @@ -22,10 +25,16 @@ jobs: password: ${{ secrets.REDHAT_REGISTRY_TOKEN }} registry: registry.redhat.io - name: Build with Maven + run: | + VERSION=${{ github.event_name == 'pull_request' && format('pr{0}-SNAPSHOT', github.event.pull_request.number) || 'latest-SNAPSHOT' }} + mvn ${{ runner.debug && '-X -e' || '' }} -B deploy -Drevision=$VERSION -Psonar,release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn ${{ runner.debug && '-X -e' || '' }} -B install -Psonar + MAVEN_GPG_KEY: ${{ secrets.OPENAPI_OSSRH_GPG_SECRET_KEY }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.OPENAPI_OSSRH_GPG_SECRET_KEY_PASSWORD }} + MAVEN_CENTRAL_USER: ${{ secrets.OPENAPI_OSSRH_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.OPENAPI_OSSRH_TOKEN }} - name: Publish doc if: github.ref == 'refs/heads/main' uses: peaceiris/actions-gh-pages@v4 diff --git a/README.md b/README.md index 899bc42d..9af54ea3 100644 --- a/README.md +++ b/README.md @@ -22,3 +22,24 @@ Documentation on how to use this library is available on https://belgif.github.i ## Build Process The build process is documented [here](https://github.com/belgif/rest-problem-java/blob/master/BUILDING.md). + +## Maven Central + +* Release artifacts are available on Maven Central (https://central.sonatype.com/namespace/io.github.belgif.rest.problem) +* Snapshot artifacts are also available (`latest-SNAPSHOT` for the main branch, `pr-SNAPSHOT` for PR branches): + +```xml + + + Central Portal Snapshots + central-portal-snapshots + https://central.sonatype.com/repository/maven-snapshots/ + + false + + + true + + + +```