Skip to content

Publish release package to the Maven Central Repository #1

Publish release package to the Maven Central Repository

Publish release package to the Maven Central Repository #1

name: Publish Release Package to Github Packages
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
server-id: github
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn --batch-mode -P codelabz-release clean deploy
env:
MAVEN_USERNAME: ${{ secrets.GH_MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.GH_MAVEN_PASSWORD }}