From aa381c300d4b0b341a1f65dfde3df683d9fc7959 Mon Sep 17 00:00:00 2001 From: Leo Ribeiro Date: Thu, 16 May 2024 17:05:46 -0400 Subject: [PATCH] Fix artifactory SNAPSHOT publishing w/o credentials (#316) --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b55acca..90fe5688 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,12 +102,15 @@ jobs: --batch-mode \ -DnewVersion=${{ steps.resolve_version.outputs.resolved_version }} - # Maven deploy lifecycle will build, run tests, verify, sign, and deploy - mvn \ - deploy \ - --batch-mode \ - --settings .maven_settings.xml \ - -P sign-artifacts + # Only attempt to publish artifact if we have credentials + if [ -n "${{ secrets.ARTIFACTORY_PASSWORD }}" ]; then + # Maven deploy lifecycle will build, run tests, verify, sign, and deploy + mvn deploy --batch-mode --settings .maven_settings.xml -P sign-artifacts + else + # Otherwise, Maven verify lifecycle will build, run tests, and verify + mvn verify --batch-mode + fi + env: ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}