diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 588f0bc..7d1eaa2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -14,13 +14,31 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: 17 - - name: Build with Maven + distribution: 'temurin' + cache: 'maven' + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + if: ${{ secrets.GPG_PRIVATE_KEY != '' }} + - name: Set up JDK 17 (without GPG) + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + if: ${{ secrets.GPG_PRIVATE_KEY == '' }} + - name: Build with Maven (with GPG) + env: + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: mvn clean install + if: ${{ secrets.GPG_PRIVATE_KEY != '' }} + - name: Build with Maven (skip GPG) + run: mvn clean install -Dgpg.skip=true + if: ${{ secrets.GPG_PRIVATE_KEY == '' }} - name: Archive production artifacts uses: actions/upload-artifact@v4