From 682a5b27aaa6586e3adabd6af16248f190d9c2d0 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 22 Jul 2024 09:05:30 +0100 Subject: [PATCH] Wait until spring-boot.rb is available when updating Homebrew tap Closes gh-41561 --- .../actions/await-http-resource/action.yml | 20 +++++++++++++++++++ .../actions/sync-to-maven-central/action.yml | 13 +++--------- .../actions/update-homebrew-tap/action.yml | 4 ++++ 3 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 .github/actions/await-http-resource/action.yml diff --git a/.github/actions/await-http-resource/action.yml b/.github/actions/await-http-resource/action.yml new file mode 100644 index 0000000000..7d2b3462b5 --- /dev/null +++ b/.github/actions/await-http-resource/action.yml @@ -0,0 +1,20 @@ +name: Await HTTP Resource +description: Waits for an HTTP resource to be available (a HEAD request succeeds) +inputs: + url: + description: 'The URL of the resource to await' + required: true +runs: + using: composite + steps: + - name: Await HTTP resource + shell: bash + run: | + url=${{ inputs.url }} + echo "Waiting for $url" + until curl --fail --head --silent ${{ inputs.url }} > /dev/null + do + echo "." + sleep 60 + done + echo "$url is available" diff --git a/.github/actions/sync-to-maven-central/action.yml b/.github/actions/sync-to-maven-central/action.yml index 8ebef462a1..e54ad040b9 100644 --- a/.github/actions/sync-to-maven-central/action.yml +++ b/.github/actions/sync-to-maven-central/action.yml @@ -38,13 +38,6 @@ runs: release: true generate-checksums: true - name: Await - shell: bash - run: | - url=${{ format('https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot/{0}/spring-boot-{0}.jar', inputs.spring-boot-version) }} - echo "Waiting for $url" - until curl --fail --head --silent $url > /dev/null - do - echo "." - sleep 60 - done - echo "$url is available" + uses: ./.github/actions/await-http-resource + with: + url: ${{ format('https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot/{0}/spring-boot-{0}.jar', inputs.spring-boot-version) }} diff --git a/.github/actions/update-homebrew-tap/action.yml b/.github/actions/update-homebrew-tap/action.yml index 52b20e0990..43a1e8b77d 100644 --- a/.github/actions/update-homebrew-tap/action.yml +++ b/.github/actions/update-homebrew-tap/action.yml @@ -16,6 +16,10 @@ runs: path: updated-homebrew-tap-repo repository: spring-io/homebrew-tap token: ${{ inputs.token }} + - name: Await Formula + uses: ./.github/actions/await-http-resource + with: + url: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/${{ inputs.spring-boot-version }}/spring-boot-cli-${{ inputs.spring-boot-version }}-homebrew.rb - name: Update Homebrew Tap shell: bash run: |