Skip to content

Deploy to Maven Central #4

Deploy to Maven Central

Deploy to Maven Central #4

name: Deploy to Maven Central
on:
workflow_dispatch:
inputs:
release_version:
description: 'Version to deploy in Maven Central (eg: v1.2.3)'
required: true
jobs:
deploy:
runs-on: ubuntu-latest
outputs:
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.release_version }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Build with Maven
run: ./mvnw --batch-mode clean install
- name: Deploy to Maven Central
run: |
./mvnw -Pinternal-release-own-project deploy
echo 'Now you have to wait for the packages to be published in Maven Central.'
echo 'You can check it in https://repo.maven.apache.org/maven2/io/archimedesfw/maven/micronaut/micronaut-kotlin-parent/'
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}