Skip to content

Move from OSSRH to maven central publishing #53

Move from OSSRH to maven central publishing

Move from OSSRH to maven central publishing #53

Workflow file for this run

name: Release
on:
pull_request:
push:
tags:
- 'v*'
# workflow_dispatch:
# inputs:
# release_tag:
# description: 'v1.0.8-oss'
# required: true
jobs:
publish:
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# ref: "v1.0.8-oss"
ref: ${{ github.event.pull_request.head.sha }}
# ref: ${{ github.event.inputs.release_tag }}
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: 11
server-id: central
distribution: "adopt"
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Configure GPG
run: |
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
gpg-connect-agent reloadagent /bye
- name: Publish to the Maven Central Repository
run: mvn -Prelease -X --batch-mode deploy -Dnvd.api.key=${{ secrets.NVD_API_KEY }}
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
# - name: Create GitHub release
# uses: softprops/action-gh-release@v1
# with:
# files: target/*.jar