Skip to content

Publish package to the Maven Central Repository #1

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #1

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
workflow_dispatch:
branches:
- "*"
-
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn --batch-mode deploy -P sonatype-oss-release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}