Skip to content

publish-release

publish-release #21

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: publish-release
on:
workflow_dispatch:
inputs:
tag:
description: 'release tag'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
distribution: 'temurin'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Set up GPG
run: |
echo "$GPG_KEY" > private.asc
gpg --import --batch private.asc
env:
GPG_KEY: ${{ secrets.signingKey }}
- name: Release to OSS staging
run: mvn deploy -s settings.xml -Dgpg.passphrase=${GPG_PASSWORD}
env:
OSS_USERNAME: ${{ secrets.ossrhUsername }}
OSS_PASSWORD: ${{ secrets.ossrhPassword }}
GPG_KEY: ${{ secrets.signingKey }}
GPG_PASSWORD: ${{ secrets.signingPassword }}