Publish #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Tag to publish" | |
type: string | |
required: true | |
default: "x.y.z" | |
jobs: | |
build: | |
name: Publication pipeline | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: 17 | |
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | |
server-username: MAVEN_USERNAME # env variable for username in deploy | |
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | |
gpg-private-key: ${{ secrets.gpg_private_key }} # Value of the GPG private key to import | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
- name: Publish tag | |
env: | |
MAVEN_USERNAME: ${{ secrets.ossrh_username }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.ossrh_password }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }} | |
run: ./mvnw -ntp --batch-mode deploy -Prelease |