Skip to content

Commit

Permalink
Sync GHA setup
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Aug 9, 2024
1 parent f75cebd commit df33bf2
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 26 deletions.
20 changes: 20 additions & 0 deletions .github/actions/await-http-resource/action.yml
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 4 additions & 4 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ inputs:
required: false
default: '8'
description: 'The Java version to compile and test with'
java-distribution:
java-early-access:
required: false
default: 'liberica'
description: 'The Java distribution to use for the build'
default: 'false'
description: 'Whether the Java version is in early access'
java-toolchain:
required: false
default: 'false'
Expand All @@ -35,7 +35,7 @@ runs:
with:
develocity-access-key: ${{ inputs.develocity-access-key }}
java-version: ${{ inputs.java-version }}
java-distribution: ${{ inputs.java-distribution }}
java-early-access: ${{ inputs.java-early-access }}
java-toolchain: ${{ inputs.java-toolchain }}
- name: Build
id: build
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/create-github-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Create GitHub Release
description: Create the release on GitHub with a changelog
inputs:
milestone:
description: 'Name of the GitHub milestone for which a release will be created'
description: Name of the GitHub milestone for which a release will be created
required: true
token:
description: 'Token to use for authentication with GitHub'
description: Token to use for authentication with GitHub
required: true
runs:
using: composite
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/prepare-gradle-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ inputs:
required: false
default: '8'
description: 'The Java version to use for the build'
java-distribution:
java-early-access:
required: false
default: 'liberica'
description: 'The Java distribution to use for the build'
default: 'false'
description: 'Whether the Java version is in early access'
java-toolchain:
required: false
default: 'false'
Expand All @@ -22,12 +22,12 @@ runs:
- name: Set Up Java
uses: actions/setup-java@v4
with:
distribution: ${{ inputs.java-distribution }}
distribution: ${{ inputs.java-early-access == 'true' && 'temurin' || 'liberica' }}
java-version: |
${{ inputs.java-version }}
${{ inputs.java-early-access == 'true' && format('{0}-ea', inputs.java-version) || inputs.java-version }}
${{ inputs.java-toolchain == 'true' && '8' || '' }}
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0
with:
cache-read-only: false
develocity-access-key: ${{ inputs.develocity-access-key }}
Expand Down
15 changes: 4 additions & 11 deletions .github/actions/sync-to-maven-central/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
using: composite
steps:
- name: Set Up JFrog CLI
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2
uses: jfrog/setup-jfrog-cli@105617d23456a69a92485207c4f28ae12297581d # v4.2.1
env:
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
- name: Download Release Artifacts
Expand All @@ -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/spring-context/{0}/spring-context-{0}.jar', inputs.spring-framework-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/spring-context/{0}/spring-context-{0}.jar', inputs.spring-framework-version) }}
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
build-and-deploy-snapshot:
name: Build and Deploy Snapshot
runs-on: ubuntu-latest
timeout-minutes: 60
if: ${{ github.repository == 'spring-projects/spring-framework' }}
steps:
- name: Check Out Code
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
ci:
name: '${{ matrix.os.name}} | Java ${{ matrix.java.version}}'
runs-on: ${{ matrix.os.id }}
timeout-minutes: 60
if: ${{ github.repository == 'spring-projects/spring-framework' }}
strategy:
matrix:
Expand Down Expand Up @@ -41,7 +42,7 @@ jobs:
uses: ./.github/actions/build
with:
java-version: ${{ matrix.java.version }}
java-distribution: ${{ matrix.java.distribution || 'liberica' }}
java-early-access: ${{ matrix.java.early-access || 'false' }}
java-toolchain: ${{ matrix.java.toolchain }}
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
- name: Send Notification
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up JFrog CLI
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2
uses: jfrog/setup-jfrog-cli@105617d23456a69a92485207c4f28ae12297581d # v4.2.1
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Promote build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-gradle-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
- uses: gradle/actions/wrapper-validation@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0

0 comments on commit df33bf2

Please sign in to comment.