Skip to content

Release to Maven Central #2

Release to Maven Central

Release to Maven Central #2

Workflow file for this run

name: Release to Maven Central
env:
MAVEN_ARGS: -B -C -V -ntp -Dhttp.keepAlive=false -e ${{ github.event.inputs.additional_args }}
RELEASE_MAVEN_ARGS: -Prelease -DstagingProgressTimeoutMinutes=20
OSSRHUSERNAME: ${{ secrets.OSSRHUSERNAME }}
OSSRHPASSWORD: ${{ secrets.OSSRHPASSWORD }}
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }}
on:
workflow_dispatch:
inputs:
tag:
description: Tag to release
required: true
additional_args:
description: Additional Maven Args
required: false
default: ''
java_distribution:
description: Java Distribution to use for release
required: true
default: 'temurin'
jobs:
release:
name: Release to maven central
# Cheap way to prevent accidental releases
# Modify the list to add users with release permissions
if: contains('["rhuss","rohanKanojia"]', github.actor)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 11
distribution: ${{ github.event.inputs.java_distribution }}
server-id: oss-sonatype-staging
server-username: OSSRHUSERNAME
server-password: OSSRHPASSWORD
gpg-private-key: ${{ secrets.SIGNINGKEY }}
gpg-passphrase: SIGNINGPASSWORD
- name: Build and Release Project
run: ./mvnw ${MAVEN_ARGS} ${RELEASE_MAVEN_ARGS} clean deploy