Skip to content

Publish package to the Maven Central Repository and GitHub Packages #15

Publish package to the Maven Central Repository and GitHub Packages

Publish package to the Maven Central Repository and GitHub Packages #15

Workflow file for this run

# This workflow will build a package using Maven and then publish it to the Maven Central Repository and GitHub Packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Publish package to the Maven Central Repository and GitHub Packages
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Publish to GitHub Packages
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}