Skip to content

Maven Publish

Maven Publish #51

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Maven Publish
on:
push:
branches: [ 'release' ]
workflow_dispatch:
inputs:
revision:
description: 'The version to publish'
required: true
default: '2.0.0-SNAPSHOT'
jobs:
build:
runs-on: ubuntu-latest
if: ${{ inputs.revision }}
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Setup Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
cache: maven
- name: Publish package
run: mvn
--batch-mode
--update-snapshots
--file pom.xml
-Drevision=${{ inputs.revision }}
-Dgpg.skip=true
deploy
--activate-profiles release,ci
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
SIGN_KEY_ID: ${{ secrets.OSS_SIGNING_KEY_ID_LONG }}
SIGN_KEY: ${{ secrets.OSS_SIGNING_KEY }}
SIGN_KEY_PASS: ${{ secrets.OSS_SIGNING_PASSWORD }}