Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Release to maven central #11

Release to maven central

Release to maven central #11

Workflow file for this run

name: Release to maven central
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.ORG_GPG_PRIVATE_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with: # configure settings.xml
distribution: 'temurin'
java-version: '11'
server-id: ossrh
server-username: OSSRH_USER
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Build and Release to Maven central
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
mvn -Prelease --batch-mode clean release:prepare release:perform
env:
OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
GH_TOKEN: ${{ github.token }}
- if: cancelled() || failure()
run: |
mvn --batch-mode release:rollback
env:
GH_TOKEN: ${{ github.token }}