Skip to content

Commit

Permalink
ci: add deployment to Maven Central
Browse files Browse the repository at this point in the history
Refs: #26
  • Loading branch information
ariwk committed Jun 27, 2024
1 parent 09f02c8 commit 120bf40
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
[
Expand All @@ -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
Expand All @@ -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 }}
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
<version>5.0.0</version>
<packaging>pom</packaging>

<name>Generic extension of Polarion ALM</name>
<description>This is a Polarion extension which provides common part to other extensions reducing code duplication</description>
<url>https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic</url>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.generic/issues</url>
</issueManagement>

<modules>
<module>pom</module>
<module>app</module>
Expand Down

0 comments on commit 120bf40

Please sign in to comment.