Skip to content

chore(main): release dev.openfeature.contrib.tools.junitopenfeature 0… #857

chore(main): release dev.openfeature.contrib.tools.junitopenfeature 0…

chore(main): release dev.openfeature.contrib.tools.junitopenfeature 0… #857

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@6a0805fcefea3d4657a47ac4c165951e33482018 # 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 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 clean deploy
done
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}