From 6a00b122df22958036f8f30cce19f46a3089dafa Mon Sep 17 00:00:00 2001 From: Sergey Grigoriev Date: Tue, 2 Jul 2024 12:24:35 +0200 Subject: [PATCH] feat: required info for publishing to maven central added --- .github/workflows/maven-release.yml | 43 ++++++++++++++++++--------- pom.xml | 45 +++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 16 deletions(-) diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index 51282a1..8e6ab4f 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -10,14 +10,15 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Set up JDK and Maven - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4 with: distribution: adopt java-version: 17 cache: maven - - uses: whelk-io/maven-settings-xml-action@9dc09b23833fa9aa7f27b63db287951856f3433d # v22 + gpg-private-key: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PRIVATE_KEY }} + - uses: whelk-io/maven-settings-xml-action@9dc09b23833fa9aa7f27b63db287951856f3433d # v22 with: repositories: > [ @@ -31,16 +32,6 @@ jobs: } } ] - profiles: > - [ - { - "id": "githubDeploy", - "properties": - { - "altDeploymentRepository": "github::default::https://maven.pkg.github.com/${{ github.repository }}" - } - } - ] servers: > [ { @@ -52,17 +43,41 @@ jobs: "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 }}" + }, + { + "id": "gpg.passphrase", + "passphrase": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE }}" + } + ] + profiles: > + [ + { + "id": "deploy-github-packages", + "properties": + { + "altDeploymentRepository": "github::default::https://maven.pkg.github.com/${{ github.repository }}" + } } ] - name: Print settings.xml run: cat /home/runner/.m2/settings.xml - name: Build with Maven run: mvn --batch-mode clean package + env: + FAIL_ON_CHECK_COMMANDS: 'true' - name: Extract artefact version id: artefact_version run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT + - name: Publish to Maven Central + if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }} + run: mvn --batch-mode deploy -P gpg-sign -P nexus-staging - name: Publish to GitHub Packages if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }} - run: mvn --batch-mode deploy -PgithubDeploy + run: mvn --batch-mode deploy -P gpg-sign -P deploy-github-packages env: GITHUB_TOKEN: ${{ github.token }} diff --git a/pom.xml b/pom.xml index 8d1f112..605e4d7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,14 +4,45 @@ ch.sbb.polarion.extensions - ch.sbb.polarion.extension.generic.parent-pom - 4.11.0 + ch.sbb.polarion.extension.generic + 6.0.0 ch.sbb.polarion.extension.api-extender 1.3.1-SNAPSHOT jar + API extension for Polarion ALM + This Polarion extension provides additional functionality which is not implemented in standard Polarion API for some reason + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender + + + + The SBB License, Version 1.0 + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender/blob/main/LICENSES/SBB.txt + + + + + + SBB Polarion Team + polarion-opensource@sbb.ch + SBB AG + http://www.sbb.ch + + + + + scm:git:git://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender.git + scm:git:ssh://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender.git + http://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender/tree/main + + + + GitHub + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender/issues + + api-extender ch.sbb.polarion.extension.api_extender @@ -48,6 +79,16 @@ org.jacoco jacoco-maven-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + org.apache.maven.plugins + maven-source-plugin +