From 747ce68ebdd6e6caab3578ae38a80534b4077d82 Mon Sep 17 00:00:00 2001 From: ariwk Date: Fri, 28 Jun 2024 16:46:02 +0200 Subject: [PATCH] ci: add deployment to Maven Central Refs: #26 --- .github/workflows/maven-release.yml | 37 +--------------- app/pom.xml | 5 --- pom/pom.xml | 69 +++++++++++++---------------- 3 files changed, 33 insertions(+), 78 deletions(-) diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index aba02e4..5961c2d 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -42,33 +42,6 @@ jobs: "id": "s3", "username": "${{ secrets.S3_SBB_POLARION_MAVEN_REPO_RW_ACCESS_KEY }}", "password": "${{ secrets.S3_SBB_POLARION_MAVEN_REPO_RW_SECRET_ACCESS_KEY }}" - }, - { - "id": "github", - "username": "${env.GITHUB_ACTOR}", - "password": "${env.GITHUB_TOKEN}" - }, - { - "id": "ossrh", - "username": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_USERNAME }}", - "password": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_TOKEN }}" - } - ] - profiles: > - [ - { - "id": "githubDeploy", - "properties": - { - "altDeploymentRepository": "github::default::https://maven.pkg.github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic" - } - }, - { - "id": "mavenCentralDeploy", - "properties": - { - "altDeploymentRepository": "ossrh::default::https://oss.sonatype.org/content/repositories/snapshots/" - } } ] - name: Print settings.xml @@ -78,17 +51,9 @@ jobs: - name: Extract artefact version id: artefact_version run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT - - name: Publish to S3 bucket - if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }} - run: mvn --batch-mode deploy -Ps3Deploy - - name: Publish to GitHub Packages - if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }} - run: mvn --batch-mode deploy -PgithubDeploy - env: - GITHUB_TOKEN: ${{ github.token }} - name: Publish to Maven Central # if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }} - run: mvn --batch-mode deploy -PmavenCentralDeploy + run: mvn --batch-mode deploy env: SIGN_KEY_PASS: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE }} OSSRH_USERNAME: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_USERNAME }} diff --git a/app/pom.xml b/app/pom.xml index 66d1a3c..b58d230 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -44,11 +44,6 @@ org.apache.maven.plugins maven-gpg-plugin - - - org.sonatype.plugins - nexus-staging-maven-plugin - diff --git a/pom/pom.xml b/pom/pom.xml index 3a8ab16..984087c 100644 --- a/pom/pom.xml +++ b/pom/pom.xml @@ -23,7 +23,6 @@ 3.7.1 3.3.0 3.2.4 - 1.6.13 5.10.2 @@ -62,6 +61,28 @@ + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + verify + + sign + + + + + + + + install-to-local-polarion @@ -433,42 +454,6 @@ - - - org.apache.maven.plugins - maven-gpg-plugin - ${maven-gpg-plugin.version} - - - sign-artifacts - verify - - sign - - - - - - --pinentry-mode - loopback - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - ${version.nexus-staging-maven-plugin} - true - - ossrh - https://oss.sonatype.org - true - - - org.apache.maven.plugins maven-dependency-plugin @@ -582,4 +567,14 @@ + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + +