Skip to content

Setup release with sonatype central #16

Setup release with sonatype central

Setup release with sonatype central #16

Workflow file for this run

name: Release
# Run workflow on tags to the `master` branch
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Java and Maven
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Create settings.xml file
uses: whelk-io/maven-settings-xml-action@v22
with:
servers: >
[
{
"id": "central",
"username": "${{ secrets.SONATYPE_CENTRAL_USERNAME }}",
"password": "${{ secrets.SONATYPE_CENTRAL_PASSWORD }}"
}
]
- name: Install gpg secret key
run: |
# Install gpg secret key
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
# Verify gpg secret key
gpg --list-secret-keys --keyid-format LONG
- name: Publish package
run: |
cat ~/.m2/settings.xml
mvn -X --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -P deploy deploy