Skip to content

Maven Deploy

Maven Deploy #130

Workflow file for this run

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Maven Deploy
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
comment:
# Friendly description to be shown in the UI instead of 'name'
description: 'Comment for deploy'
# Default value if no value is explicitly provided
default: 'Deploy SNAPSHOT from WEB UI'
# Input has to be provided for the workflow to run
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/.github/.m2/settings.xml
env:
GITHUB_TOKEN: '${{ secrets.GH_TOKEN_TECHUSER_JAVA }}'
OSSRH_USERNAME: '${{ secrets.OSS_SONATYPE_ORG_USER }}'
OSSRH_PASSWORD: '${{ secrets.OSS_SONATYPE_ORG_PASSWORD }}'