Skip to content

check if gpg is installed and what is the version used #49

check if gpg is installed and what is the version used

check if gpg is installed and what is the version used #49

name: Java Build, Lint and Test
on:
push:
jobs:
build-test-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Xero-Java repo
uses: actions/checkout@v4
with:
repository: XeroAPI/Xero-Java
path: Xero-Java
- name: Set up JDK environment
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: maven
- name: Import GPG Key
run: |
if command -v gpg > /dev/null 2>&1; then
echo "GPG is installed."
gpg --version
else
echo "GPG is not installed."
exit 1
fi
mkdir -p ~/.gnupg
chmod 700 ~/.gnupg
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY}}
- name: Build and test post generation
run: |
export GPG_TTY=$(tty)
mvn clean verify -DskipTests=true -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
working-directory: Xero-Java