diff --git a/.github/workflows/maven-central-deployment.yml b/.github/workflows/maven-central-deployment.yml new file mode 100644 index 00000000..44ab743e --- /dev/null +++ b/.github/workflows/maven-central-deployment.yml @@ -0,0 +1,25 @@ +name: Publish package to the Maven Central Repository +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup central + uses: actions/setup-java@v4 + with: + java-version: 17 + cache: maven + distribution: 'temurin' + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.CENTRAL_GPG_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Publish package + run: mvn --batch-mode deploy -DskipTests -Pcentral-release + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_TOKEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.CENTRAL_GPG_KEY_PASSWORD }} diff --git a/pom.xml b/pom.xml index a24a86e8..39167ac2 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,8 @@ ~ limitations under the License. --> - + 4.0.0 com.phonepe.drove @@ -170,6 +171,20 @@ 17 + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + verify + + jar-no-fork + + + + org.apache.maven.plugins maven-surefire-plugin @@ -207,4 +222,74 @@ + + + central-release + + + release + true + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 + true + + central + true + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + + + + add-java-open-options-for-jdk16+ + + [16,) + + + + --add-opens java.base/java.net=ALL-UNNAMED + --add-opens java.base/sun.net=ALL-UNNAMED + + + + +