Skip to content

Commit e4ba133

Browse files
committed
Add await-http-resource action
* Use `await-http-resource` action in the `spring-artifactory-deploy-to-maven-central.yml` to wait until one of the jars from the release is available in Maven Central repo
1 parent 26539fc commit e4ba133

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Await HTTP Resource
2+
description: 'Waits for an HTTP resource to be available (a HEAD request succeeds)'
3+
inputs:
4+
url:
5+
description: 'URL of the resource to await'
6+
required: true
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Await HTTP resource
11+
shell: bash
12+
run: |
13+
echo "Waiting for ${{ inputs.url }}"
14+
until curl --fail --head --silent "${{ inputs.url }}" > /dev/null
15+
do
16+
echo "."
17+
sleep 60
18+
done
19+
echo "${{ inputs.url }} is available"

.github/workflows/spring-artifactory-deploy-to-maven-central.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ jobs:
4545
- uses: jfrog/setup-jfrog-cli@v4
4646

4747
- name: Download Release Files
48+
id: download-release-files
4849
run: |
4950
jfrog rt download \
5051
--spec utils/release-files-spec.json \
5152
--spec-vars "buildname=${{ inputs.buildName }};buildnumber=${{ inputs.buildNumber }}"
53+
54+
jarToCheck=$(find nexus -name "*.jar" -print -quit)
55+
jarToCheck=${jarToCheck#nexus}
56+
echo jarToCheck=$jarToCheck >> $GITHUB_OUTPUT
5257
5358
- uses: spring-io/nexus-sync-action@v0.0.1
5459
id: nexus
@@ -63,4 +68,9 @@ jobs:
6368
close: true
6469
release: true
6570
close-timeout: 3600
66-
release-timeout: 3600
71+
release-timeout: 3600
72+
73+
- name: Await for Artifact in Maven Central Repository
74+
uses: ./.github/actions/await-http-resource
75+
with:
76+
url: 'https://repo.maven.apache.org/maven2'${{ steps.download-release-files.outputs.jarToCheck }}

0 commit comments

Comments
 (0)