Skip to content

Update pom.xml

Update pom.xml #9

Workflow file for this run

name: Release to Maven Central
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: "maven"
server-id: ossrh
server-username: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
server-password: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
gpg-private-key: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
gpg-passphrase: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
- name: Import GPG key
run: |
echo "${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}" | gpg --import
echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
gpg-connect-agent reloadagent /bye
- name: Setup Maven settings.xml
run: |
mkdir -p ~/.m2
echo "<settings><servers><server><id>ossrh</id><username>${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}</username><password>${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}</password></server></servers></settings>" > ~/.m2/settings.xml
- name: Build and test
run: mvn -B clean verify
env:
MAVEN_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
MAVEN_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
INFISICAL_MACHINE_IDENTITY_CLIENT_ID: ${{ secrets.INFISICAL_MACHINE_IDENTITY_CLIENT_ID }}
INFISICAL_MACHINE_IDENTITY_CLIENT_SECRET: ${{ secrets.INFISICAL_MACHINE_IDENTITY_CLIENT_SECRET }}
INFISICAL_PROJECT_ID: ${{ secrets.INFISICAL_PROJECT_ID }}
INFISICAL_SITE_URL: ${{ secrets.INFISICAL_SITE_URL }}
- name: Set version
run: |
VERSION=${GITHUB_REF#refs/tags/}
mvn versions:set -DnewVersion=${VERSION} -DgenerateBackupPoms=false
- name: Publish to Maven Central
env:
# Release
MAVEN_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
MAVEN_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
run: |
mvn --batch-mode \
--no-transfer-progress \
clean deploy \
-P release \
-DskipTests