Skip to content

Publish package to the Maven Central Repository #64

Publish package to the Maven Central Repository

Publish package to the Maven Central Repository #64

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
architecture: x64
cache: maven
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
gpg-private-key: ${{ secrets.RUNE_GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Set version
shell: bash
run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }}
- name: Publish package
run: mvn -B -U clean deploy -P release
env:
GPG_KEYNAME: ${{ secrets.RUNE_GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.RUNE_GPG_PASSPHRASE }}
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}