Skip to content

chore: Update pom.xml for GitHub Packages integration and remove cent… #30

chore: Update pom.xml for GitHub Packages integration and remove cent…

chore: Update pom.xml for GitHub Packages integration and remove cent… #30

Workflow file for this run

name: Publish to Maven Central
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
jobs:
publish-snapshot:
name: Publish Snapshot
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Publish package
run: |
mvn -P snapshot --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-release:
name: Publish Release
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java for publishing to Maven Central
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish package
run: |
mvn -P release --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}