Skip to content

Commit

Permalink
producing a maintenance release with Ossrh
Browse files Browse the repository at this point in the history
  • Loading branch information
psenin-sanofi committed Dec 28, 2021
1 parent 248dea3 commit 50988a0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 28 deletions.
51 changes: 27 additions & 24 deletions .github/workflows/publish.yml
Expand Up @@ -44,27 +44,30 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish_maven_central:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to the Maven Central Repository
run: mvn --batch-mode -P mavenCentral deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
# wouldn't work with maven central as github wouldn't pack javadocs and sources...
# need to figure that out ... released manually
#
# publish_maven_central:
# runs-on: ubuntu-latest
# needs: build
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@v2
# - name: Set up Java for publishing to Maven Central Repository
# uses: actions/setup-java@v2
# with:
# java-version: '11'
# distribution: 'temurin'
# server-id: ossrh
# server-username: MAVEN_USERNAME
# server-password: MAVEN_PASSWORD
# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
# gpg-passphrase: MAVEN_GPG_PASSPHRASE
# - name: Publish to the Maven Central Repository
# run: mvn --batch-mode -P mavenCentral deploy
# env:
# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
23 changes: 19 additions & 4 deletions pom.xml
Expand Up @@ -17,6 +17,7 @@
<maven-jxr-plugin.version>3.1.1</maven-jxr-plugin.version>
<maven-findbugs-plugin.version>3.0.5</maven-findbugs-plugin.version>
<maven-jacoco-plugin.version>0.8.7</maven-jacoco-plugin.version>
<gpg.keyname>0xF96A2E08</gpg.keyname>
</properties>

<dependencies>
Expand Down Expand Up @@ -45,6 +46,11 @@
<artifactId>jfreechart</artifactId>
<version>1.0.19</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.1.2</version>
</dependency>
</dependencies>

<organization>
Expand Down Expand Up @@ -223,7 +229,7 @@
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>

Expand Down Expand Up @@ -264,6 +270,10 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>${gpg.keyname}</keyname>
<passphraseServerId>${gpg.keyname}</passphraseServerId>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -329,7 +339,7 @@
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
Expand All @@ -356,6 +366,11 @@

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
Expand All @@ -371,11 +386,11 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
</plugin>
<plugin>
<!-- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${maven-findbugs-plugin.version}</version>
</plugin>
</plugin> -->
</plugins>
</reporting>

Expand Down

0 comments on commit 50988a0

Please sign in to comment.