Skip to content

v4.24.0

v4.24.0 #41

name: Release Extension to Sonatype
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
tag:
description: 'Release Tag'
required: true
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.collect-data.outputs.tag }}
steps:
- name: Collect Data
id: collect-data
uses: actions/github-script@v4
with:
script: |
let tag;
if (context.payload.inputs) {
tag = context.payload.inputs.tag;
} else {
tag = context.payload.release.tag_name;
}
core.setOutput("tag", tag);
- run: |
echo "Publishing from ${{ steps.collect-data.outputs.tag }}"
release:
runs-on: ubuntu-latest
needs: [ setup ]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ needs.setup.outputs.tag }}
- name: Set up Java for publishing to Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SECRET }}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish to the Maven Central Repository
run: mvn clean deploy -Dmaven.test.skip -P release
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}