Skip to content

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Configure Maven to use GitHub Packages
run: |
echo "<settings>
<servers>
<server>
<id>github</id>
<username>${{ github.actor }}</username>
<password>${{ secrets.GITHUB_TOKEN }}</password>
</server>
</servers>
</settings>" > $HOME/.m2/settings.xml
- name: Publish package
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}