diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3961a78..a915af0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,26 +5,21 @@ on: [workflow_dispatch] jobs: deployment: runs-on: ubuntu-latest + name: Deploy to Maven environment: Deploy - name: PathExpression deployment steps: - name: Checkout source code uses: actions/checkout@v4 - # Sets up Java version - - name: Set up Java - uses: actions/setup-java@v4 + + - name: Deploy version + uses: secure-software-engineering/actions/deployment/maven-deployment@maven-central-deploy with: - distribution: 'adopt' - java-package: 'jdk' - java-version: '8' - server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin - server-username: OSSRH_USERNAME # Env var that holds your OSSRH user name - server-password: OSSRH_PASSWORD # Env var that holds your OSSRH user pw - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Substituted with the value stored in the referenced secret - gpg-passphrase: SIGN_KEY_PASS # Env var that holds the key's passphrase - - name: Build & Deploy PathExpression - run: mvn -B -U clean deploy -Pdeployment - env: - SIGN_KEY_PASS: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} - OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }} - OSSRH_PASSWORD: ${{ secrets.SONATYPE_PW }} + java-distribution: adopt + java-version: 11 + server-id: central + server-username: ${{ secrets.SONATYPE_USER }} + server-password: ${{ secrets.SONATYPE_PW }} + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} + mvn-cli-args: '-DskipTests -Pdeployment' + deploy-mode: release \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/test.yml similarity index 85% rename from .github/workflows/maven.yml rename to .github/workflows/test.yml index c36b231..f6227e2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,10 @@ -name: Java CI with Maven +name: Run Tests on: push: + branches: + - develop + - master pull_request: jobs: diff --git a/pom.xml b/pom.xml index 162d7d4..fa52a9a 100644 --- a/pom.xml +++ b/pom.xml @@ -44,17 +44,19 @@ deployment - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.7.0 - true - - ossrh - https://s01.oss.sonatype.org - true - - + + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + ${project.artifactId} ${project.version} + + central + published + true + + org.apache.maven.plugins maven-source-plugin @@ -142,15 +144,4 @@ 2.25.1 - - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots/ - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - -