-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2b3e1c
commit d9e26fd
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Publish package to the Maven Central Repository | ||
on: | ||
push: | ||
branches: | ||
- release/* | ||
|
||
# this is required by spotless for JDK 16+ | ||
env: | ||
JAVA_11_PLUS_MAVEN_OPTS: "--add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Maven Central Repository | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
server-id: sonatype-nexus-staging | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
- name: Maven Install and Site with Code Coverage | ||
env: | ||
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }} | ||
run: mvn -B clean install site -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: maven-target-directory | ||
path: target/ | ||
retention-days: 3 | ||
|
||
- name: Publish package | ||
run: mvn -B clean deploy -DskipTests -Prelease | ||
env: | ||
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }} | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }} |