Skip to content

Commit 6632825

Browse files
committed
[CI] Update central-publish-action
This is a manual cherry pick of commit 2e73ad8 from main that fixes a recent breakage w/ dpeloy to Central. Signed-off-by: onobc <[email protected]>
1 parent 962a757 commit 6632825

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ jobs:
142142
deploy_location=central
143143
fi
144144
echo "deploy_location=$deploy_location" >> $GITHUB_OUTPUT
145-
- name: Publish artifacts (Artifactory or staged for Central)
145+
146+
- name: Publish Artifacts to Artifactory
147+
if: ${{ steps.deploy-location.outputs.deploy_location == 'artifactory' }}
146148
env:
147149
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
148150
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
@@ -153,17 +155,45 @@ jobs:
153155
ARTIFACTORY_USER_AGENT_VERSION: Unknown
154156
ARTIFACTORY_VCS_REVISION: ${{ github.sha }}
155157
run: |
156-
./gradlew publishArtifacts \
158+
./gradlew artifactoryPublish \
157159
--stacktrace \
158160
-PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD"
159-
- name: Publish staged artifacts to Central
161+
162+
- name: Stage Local Artifacts for Publishing to Central
163+
if: ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
164+
env:
165+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
166+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
167+
run: |
168+
./gradlew publishAllPublicationsToLocalRepository --stacktrace
169+
# rm checksums to work around https://github.com/spring-io/central-publish-action/issues/11
170+
find -name "*.md5" | xargs rm -f
171+
find -name "*.sha*" | xargs rm -f
172+
173+
- name: Publish Staged Artifacts to Central
160174
if: ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
161-
uses: spring-io/[email protected]
175+
uses: spring-io/central-publish-action@0cdd90d12e6876341e82860d951e1bcddc1e51b6 # v0.2.0
162176
with:
163177
token-name: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
164178
token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
165179
dir: build/publications/repos
166-
fail-on-existing-checksums: false
180+
181+
- name: Still publish docs module to Artifactory when deploy location is Central
182+
if: ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
183+
env:
184+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
185+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
186+
ARTIFACTORY_BUILD_NAME: ${{ github.event.repository.name }}-${{ steps.branch-name.outputs.branch }}
187+
ARTIFACTORY_BUILD_NUMBER: ${{ github.run_id }}
188+
ARTIFACTORY_BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
189+
ARTIFACTORY_USER_AGENT_NAME: GitHub Actions
190+
ARTIFACTORY_USER_AGENT_VERSION: Unknown
191+
ARTIFACTORY_VCS_REVISION: ${{ github.sha }}
192+
run: |
193+
./gradlew :spring-pulsar-docs:artifactoryPublish \
194+
--stacktrace \
195+
-PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD"
196+
167197
deploy_docs_antora:
168198
name: Deploy Antora Docs
169199
needs: [build_jdk_17, check_samples, scan]

0 commit comments

Comments
 (0)