Skip to content

chore(deps): update dependency org.apache.maven.plugins:maven-gpg-plu… #919

chore(deps): update dependency org.apache.maven.plugins:maven-gpg-plu…

chore(deps): update dependency org.apache.maven.plugins:maven-gpg-plu… #919

on:
push:
branches:
- main
name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
# The logic below handles the maven publication:
- name: Checkout Repository
if: ${{ steps.release.outputs.releases_created }}
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up JDK 8
if: ${{ steps.release.outputs.releases_created }}
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
- name: Cache local Maven repository
if: ${{ steps.release.outputs.releases_created }}
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Configure GPG Key
if: ${{ steps.release.outputs.releases_created }}
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
# Release Please has already incremented versions and published tags, so we just need to publish (skip tests).
- name: Maven Verify Deploy -DskipTests
if: ${{ steps.release.outputs.releases_created }}
# The nexus-staging-maven-plugin doesn't follow maven conventions. It stages all the projects with the last submodule: https://help.sonatype.com/repomanager2/staging-releases/configuring-your-project-for-deployment
# This means there's no way to skip publishing of a particular module in a multi-module build, so we iterate over each module and publish them individually,
# letting exists-maven-plugin skip the nexus-staging-maven-plugin's entire deploy goal if the artifact exists.
run: |
mvn --non-recursive --batch-mode --settings release/m2-settings.xml -DskipTests clean deploy
modules=($(cat pom.xml | grep "<module>" | sed 's/\s*<.*>\(.*\)<.*>/\1/'))
for module in "${modules[@]}"
do
mvn --batch-mode --projects $module --settings release/m2-settings.xml -DskipTests clean deploy
done
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}