Skip to content

fix: use -Dmaven.test.skip=true to skip test compilation in CI #4

fix: use -Dmaven.test.skip=true to skip test compilation in CI

fix: use -Dmaven.test.skip=true to skip test compilation in CI #4

Workflow file for this run

name: Publish to Maven Central
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Import GPG key
run: |
echo "$GPG_SIGNING_KEY" | gpg --batch --import
gpg --list-secret-keys --keyid-format=long
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Write Maven settings
run: |
mkdir -p ~/.m2
cat > ~/.m2/settings.xml << EOF
<settings>
<servers>
<server>
<id>central</id>
<username>${CENTRAL_USERNAME}</username>
<password>${CENTRAL_PASSWORD}</password>
</server>
</servers>
</settings>
EOF
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
- name: Publish to Maven Central
run: |
mvn --no-transfer-progress --batch-mode -Dmaven.test.skip=true \
-Dgpg.keyname=${{ secrets.GPG_KEY_ID }} \
deploy