Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

3.2.7

3.2.7 #21

Workflow file for this run

name: Publish release
on:
release:
types: [published]
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Setup build cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Publish artifact
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_KEYS: ${{ secrets.GPG_KEYS }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
# So if we split on '/' and take the 3rd value, we can get the release name.
run: |
export GPG_TTY=$(tty) && echo "$GPG_KEYS" | gpg --fast-import --batch
REPO_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "-- Setting new release version ${NEW_VERSION} for ${REPO_NAME} --"
mvn -B versions:set -DnewVersion="${NEW_VERSION}" -DgenerateBackupPoms=false
echo "-- Build, test and deploy release to Sonatype --"
mvn -B --settings .github/settings.xml clean deploy -Prelease,deploy-to-sonatype -Dmaven.wagon.http.pool=false