Skip to content

Commit

Permalink
💚 Fixing CI Build. github action supoort jdk 17
Browse files Browse the repository at this point in the history
  • Loading branch information
lbw committed Dec 6, 2022
1 parent 81ffd66 commit b4b83c2
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: mvn clean install
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: publish maven package

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
oss-deploy:
oss-release-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -17,6 +17,7 @@ jobs:
java-version: '17'
distribution: 'adopt'
cache: maven

- name: Setup Maven Central
uses: actions/setup-java@v3
with: # overwrite settings.xml
Expand All @@ -29,7 +30,7 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
run: mvn clean deploy -Dmaven.test.skip=true -P 'release'
run: mvn clean deploy -P release -Dmaven.test.skip=true
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/oss-snapshot-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: publish maven package
on:
workflow_dispatch:
push:
branches: [ master ]

jobs:
oss-snapshot-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
cache: maven

- name: Setup Maven Central
uses: actions/setup-java@v3
with: # overwrite settings.xml
java-version: '17'
distribution: 'adopt'
server-id: sonatype
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Set Release version env variable
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Publish to Maven Central
if: contains('${{ env.RELEASE_VERSION }}', 'SNAPSHOT')
run: mvn clean deploy -P snapshot -Dmaven.test.skip=true
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

0 comments on commit b4b83c2

Please sign in to comment.