Skip to content

Commit 2e73ad8

Browse files
committed
[CI] Update central-publish-action (take 5)
Moving all the magic out my way Signed-off-by: onobc <[email protected]>
1 parent a11b9a7 commit 2e73ad8

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 6 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 (to Artifactory or stage them 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,19 +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
160163
if: ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
161-
uses: spring-io/central-publish-action@f4011b13b62eccc4db5f7e0fb4bdf37b4b80750f # v0.2.0
162164
env:
163-
ACTION_STEPS_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
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
174+
if: ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
175+
uses: spring-io/central-publish-action@0cdd90d12e6876341e82860d951e1bcddc1e51b6 # v0.2.0
164176
with:
165177
token-name: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
166178
token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
167179
dir: build/publications/repos
168-
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+
169197
deploy_docs_antora:
170198
name: Deploy Antora Docs
171199
needs: [build_jdk_17, check_samples, scan]

0 commit comments

Comments
 (0)