Skip to content

refactor callback

refactor callback #23

Workflow file for this run

name: Java CI
env:
JDK_CURRENT: 11
DISTRIBUTION: zulu
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Set up JDK
uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # tag=v3
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.DISTRIBUTION }}
- name: Cache Maven dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B clean install
deploy:
if: startsWith(github.ref, 'refs/heads/')
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Set up JDK
uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # tag=v3
with:
java-version: ${{ env.JDK_CURRENT }}
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
distribution: ${{ env.DISTRIBUTION }}
- name: Deploy to Sonatype
run: mvn -B -DskipTests deploy
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USER }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PWD }}