From 120bf4066ce6b2ff54cea0935f49c17573b9de3f Mon Sep 17 00:00:00 2001 From: ariwk Date: Thu, 27 Jun 2024 13:44:48 +0200 Subject: [PATCH] ci: add deployment to Maven Central Refs: #26 --- .github/workflows/maven-release.yml | 33 ++++++++++++++++++++++------- pom.xml | 9 ++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index a0ba37c..e9e874c 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -10,14 +10,14 @@ 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 + - uses: whelk-io/maven-settings-xml-action@9dc09b23833fa9aa7f27b63db287951856f3433d # v22 with: repositories: > [ @@ -42,23 +42,34 @@ 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 }}" } ] profiles: > [ { - "id": "s3Deploy", + "id": "githubDeploy", "properties": { - "altDeploymentRepository": "s3::default::s3://sbb-polarion-maven-repo/polarion.mvn" + "altDeploymentRepository": "github::default::https://maven.pkg.github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic" } }, { - "id": "githubDeploy", + "id": "mavenCentralDeploy", "properties": { - "altDeploymentRepository": "github::default::https://maven.pkg.github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic" - } + "altDeploymentRepository": "ossrh::default::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + }, + { + "altReleaseDeploymentRepository": "ossrh::default::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + }, + { + "altSnapshotDeploymentRepository": "ossrh::default::https://s01.oss.sonatype.org/content/repositories/snapshots/" + }, } ] - name: Print settings.xml @@ -76,3 +87,9 @@ jobs: run: mvn --batch-mode deploy -PgithubDeploy env: GITHUB_TOKEN: ${{ github.token }} + - name: Publish to Maven Central + # if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') }} + run: mvn -B sign-artifacts deploy -PmavenCentralDeploy + env: + gpg-private-key: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PRIVATE_KEY }} + gpg-passphrase: ${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE }} diff --git a/pom.xml b/pom.xml index 5d42234..153f258 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,15 @@ 5.0.0 pom + Generic extension of Polarion ALM + This is a Polarion extension which provides common part to other extensions reducing code duplication + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic + + + GitHub + https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic/issues + + pom app