Skip to content

publish package to the Maven Central Repository #7

publish package to the Maven Central Repository

publish package to the Maven Central Repository #7

Workflow file for this run

name: publish package to the Maven Central Repository
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup java/maven
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: import gpg private key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: list gpg keys
run: gpg -K
- name: create maven settings.xml
uses: whelk-io/maven-settings-xml-action@v20
with:
servers: >
[
{
"id": "central",
"username": "${{ secrets.CENTRAL_TOKEN_USER }}",
"password": "${{ secrets.CENTRAL_TOKEN_PASS }}"
}
]
output_file: /home/runner/.m2/settings.xml
- name: publish package
run: mvn --batch-mode -Dgpg.passphrase='${{ secrets.GPG_PASSPHRASE }}' clean deploy -P release