Skip to content

Deploy the maven artifacts signed on Maven Central #13

Deploy the maven artifacts signed on Maven Central

Deploy the maven artifacts signed on Maven Central #13

Workflow file for this run

name: Deploy the maven artifacts signed on Maven Central
on:
workflow_dispatch:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'adopt'
server-id: central
server-username: MAVEN_USERNAME # ${{ secrets.MAVEN_USERNAME }}
server-password: MAVEN_PASSWORD # ${{ secrets.MAVEN_PASSWORD }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE # Don't work => ${{ secrets.GPG_PASSPHRASE }} as env var name should be defined
- name: Check the gpg key
run: |
gpg --list-keys
- name: Publish package
run: |
mvn -B -ntp deploy -DskipTests -Prelease
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}