@@ -77,45 +77,48 @@ jobs:
7777 if [[ "$deploy_location" = "true" ]] ; then
7878 if [[ "$VERSION" =~ "-SNAPSHOT" ]] ; then
7979 # always default -SNAPSHOT to artifactory
80- deploy_location=libs-snapshot-local
80+ deploy_location=artifactory
8181 elif [[ "$DEFAULT_PUBLISH_MILESTONE_CENTRAL" = "true" ]] ; then
8282 # if configured, non -SNAPSHOT go to central
8383 deploy_location=central
8484 elif [[ "$VERSION" =~ "-" ]] ; then
8585 # -M\d+, and -RC\d+ all go to artifactory by default to remain passive
8686 # Newer generations will only deploy -SNAPSHOT to artifactory, but they must specify default-publish-milestone-central=true
87- deploy_location=libs-milestone-local
87+ deploy_location=artifactory
8888 else
8989 deploy_location=central
9090 fi
9191 fi
9292 echo "deploy_location=$deploy_location" >> $GITHUB_OUTPUT
93+ - name : Deploy to Artifactory
94+ if : ${{ steps.deploy-location.outputs.deploy_location == 'artifactory' }}
95+ env :
96+ ORG_GRADLE_PROJECT_signingKey : ${{ secrets.GPG_PRIVATE_KEY }}
97+ ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.GPG_PASSPHRASE }}
98+ ARTIFACTORY_BUILD_NAME : ${{ github.event.repository.name }}-${{ steps.branch-name.outputs.branch }}
99+ ARTIFACTORY_BUILD_NUMBER : ${{ github.run_id }}
100+ ARTIFACTORY_BUILD_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
101+ ARTIFACTORY_USER_AGENT_NAME : GitHub Actions
102+ ARTIFACTORY_USER_AGENT_VERSION : Unknown
103+ ARTIFACTORY_VCS_REVISION : ${{ github.sha }}
104+ run : ./gradlew artifactoryPublish -PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD" --stacktrace
93105 - name : Stage Local Artifacts for Publishing to Central
106+ if : ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
94107 env :
95108 ORG_GRADLE_PROJECT_signingKey : ${{ secrets.GPG_PRIVATE_KEY }}
96109 ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.GPG_PASSPHRASE }}
97110 run : |
98111 ./gradlew publishAllPublicationsToLocalRepository --stacktrace
99- - name : Deploy to Artifactory
100- if : ${{ steps.deploy-location.outputs.deploy_location != 'artifactory' }}
101- 102- with :
103- uri : " https://repo.spring.io"
104- repository : ${{ steps.deploy-location.outputs.deploy_location }}
105- build-name : ${{ github.event.repository.name }}-${{ steps.branch-name.outputs.branch }}
106- build-uri : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
107- username : ${{ secrets.ARTIFACTORY_USERNAME }}
108- password : ${{ secrets.ARTIFACTORY_PASSWORD }}
109- vcs-revision : ${{ github.sha }}
110- folder : build/publications/repos
112+ # rm checksums to work around https://github.com/spring-io/central-publish-action/issues/11
113+ find -name "*.md5" | xargs rm -f
114+ find -name "*.sha*" | xargs rm -f
111115 - name : Publish Staged Artifacts to Central
112116 if : ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
113117114118 with :
115119 token-name : ${{ secrets.CENTRAL_TOKEN_USERNAME }}
116120 token : ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
117121 dir : build/publications/repos
118- fail-on-existing-checksums : false
119122 - id : artifacts-deployed
120123 name : Artifacts Deployed
121124 run : echo "result=true" >> $GITHUB_OUTPUT
0 commit comments