Skip to content

0.9.12 General modernisation #22

0.9.12 General modernisation

0.9.12 General modernisation #22

Workflow file for this run

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Maven Package
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Verify GPG key format
run: |
echo "Checking if GPG key has proper headers..."
if echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | grep -q "BEGIN PGP PRIVATE KEY BLOCK"; then
echo "✓ GPG key has proper header"
else
echo "✗ GPG key missing proper header!"
echo "Key should start with: -----BEGIN PGP PRIVATE KEY BLOCK-----"
exit 1
fi
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: 21
distribution: 'zulu'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish package
run: mvn --no-transfer-progress --batch-mode -DperformRelease=true clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}