Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/actions/jdk-setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
name: "JDK Setup"
description: "Set up Temurin JDK 21 with Maven dependency caching"
inputs:
server-id:
description: "Maven settings.xml server id for Maven Central authentication."
required: false
default: ''
server-username:
description: "Environment variable name for the Maven Central username."
required: false
default: ''
server-password:
description: "Environment variable name for the Maven Central password."
required: false
default: ''
gpg-private-key:
description: "GPG private key to import for artifact signing."
required: false
default: ''
gpg-passphrase:
description: "Environment variable name for the GPG passphrase."
required: false
default: ''
runs:
using: "composite"
steps:
- name: Set up JDK 21
if: ${{ inputs.server-id == '' }}
uses: actions/setup-java@v5
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Set up JDK 21 with Maven Central credentials
if: ${{ inputs.server-id != '' }}
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: maven
server-id: ${{ inputs.server-id }}
server-username: ${{ inputs.server-username }}
server-password: ${{ inputs.server-password }}
gpg-private-key: ${{ inputs.gpg-private-key }}
gpg-passphrase: ${{ inputs.gpg-passphrase }}
2 changes: 2 additions & 0 deletions .github/workflows/deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-java@v5
with:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release to Maven Central

on:
push:
tags: ['v*'] # created by maven-release-plugin (tagNameFormat v@{project.version})

permissions:
contents: read

concurrency:
group: release-deploy
cancel-in-progress: false

env:
MAVEN_COMMAND: ./mvnw
MAVEN_CLI_COMMON: "-e -B -N"

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 30
environment: release
steps:
- uses: actions/checkout@v7
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false

- uses: ./.github/actions/jdk-setup
with:
server-id: central-publish
server-username: CENTRAL_USERNAME
server-password: CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Deploy release to Maven Central
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: ${{ env.MAVEN_COMMAND }} ${{ env.MAVEN_CLI_COMMON }} deploy -Prelease -DskipTests