Skip to content

Commit

Permalink
feat: required info for publishing to maven central added
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoriev committed Jul 2, 2024
1 parent a9a88d8 commit 6a00b12
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 16 deletions.
43 changes: 29 additions & 14 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
[
Expand All @@ -31,16 +32,6 @@ jobs:
}
}
]
profiles: >
[
{
"id": "githubDeploy",
"properties":
{
"altDeploymentRepository": "github::default::https://maven.pkg.github.com/${{ github.repository }}"
}
}
]
servers: >
[
{
Expand All @@ -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 }}
45 changes: 43 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,45 @@

<parent>
<groupId>ch.sbb.polarion.extensions</groupId>
<artifactId>ch.sbb.polarion.extension.generic.parent-pom</artifactId>
<version>4.11.0</version>
<artifactId>ch.sbb.polarion.extension.generic</artifactId>
<version>6.0.0</version>
</parent>

<artifactId>ch.sbb.polarion.extension.api-extender</artifactId>
<version>1.3.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>API extension for Polarion ALM</name>
<description>This Polarion extension provides additional functionality which is not implemented in standard Polarion API for some reason</description>
<url>https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender</url>

<licenses>
<license>
<name>The SBB License, Version 1.0</name>
<url>https://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender/blob/main/LICENSES/SBB.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>SBB Polarion Team</name>
<email>[email protected]</email>
<organization>SBB AG</organization>
<organizationUrl>http://www.sbb.ch</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender.git</connection>
<developerConnection>scm:git:ssh://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender.git</developerConnection>
<url>http://github.com/SchweizerischeBundesbahnen/ch.sbb.polarion.extension.api-extender/tree/main</url>
</scm>

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

<properties>
<maven-jar-plugin.Extension-Context>api-extender</maven-jar-plugin.Extension-Context>
<maven-jar-plugin.Automatic-Module-Name>ch.sbb.polarion.extension.api_extender</maven-jar-plugin.Automatic-Module-Name>
Expand Down Expand Up @@ -48,6 +79,16 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 6a00b12

Please sign in to comment.