Skip to content

add maven central release workflow #3

add maven central release workflow

add maven central release workflow #3

---
name: Publish package to the Maven Central Repository
on:
release:
types: [ created ]
push:
branches:
- main
- develop
- releases/**
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Maven Central
uses: actions/setup-java@v3
with:
java-version: 17
distribution: corretto
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish Package
run: mvn --batch-mode --no-transfer-progress clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}