Skip to content

Commit f3ef586

Browse files
committed
Update GitHub actions
1 parent 4bf4f99 commit f3ef586

File tree

5 files changed

+77
-39
lines changed

5 files changed

+77
-39
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
url=${{ inputs.url }}
14+
echo "Waiting for $url"
15+
until curl --fail --head --silent ${{ inputs.url }} > /dev/null
16+
do
17+
echo "."
18+
sleep 60
19+
done
20+
echo "$url is available"

.github/actions/prepare-gradle-build/action.yml

+32-13
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,63 @@
1-
name: 'Prepare Gradle Build'
1+
name: Prepare Gradle Build
22
description: 'Prepares a Gradle build. Sets up Java and Gradle and configures Gradle properties'
33
inputs:
4-
java-version:
4+
cache-read-only:
5+
description: 'Whether Gradle''s cache should be read only'
6+
required: false
7+
default: 'true'
8+
develocity-access-key:
9+
description: 'Access key for authentication with ge.spring.io'
510
required: false
6-
default: '17'
7-
description: 'The Java version to use for the build'
811
java-distribution:
12+
description: 'Java distribution to use'
913
required: false
1014
default: 'liberica'
11-
description: 'The Java distribution to use for the build'
12-
java-toolchain:
15+
java-early-access:
16+
description: 'Whether the Java version is in early access. When true, forces java-distribution to temurin'
1317
required: false
1418
default: 'false'
19+
java-toolchain:
1520
description: 'Whether a Java toolchain should be used'
16-
develocity-access-key:
1721
required: false
18-
description: 'The access key for authentication with ge.spring.io'
22+
default: 'false'
23+
java-version:
24+
description: 'Java version to use for the build'
25+
required: false
26+
default: '17'
1927
runs:
2028
using: composite
2129
steps:
30+
- name: Free Disk Space
31+
if: ${{ runner.os == 'Linux' }}
32+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
33+
with:
34+
tool-cache: true
35+
docker-images: false
2236
- name: Set Up Java
2337
uses: actions/setup-java@v4
2438
with:
25-
distribution: ${{ inputs.java-distribution }}
39+
distribution: ${{ inputs.java-early-access == 'true' && 'temurin' || (inputs.java-distribution || 'liberica') }}
2640
java-version: |
27-
${{ inputs.java-version }}
41+
${{ inputs.java-early-access == 'true' && format('{0}-ea', inputs.java-version) || inputs.java-version }}
2842
${{ inputs.java-toolchain == 'true' && '17' || '' }}
29-
- name: Set Up Gradle
30-
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
43+
- name: Set Up Gradle With Read/Write Cache
44+
if: ${{ inputs.cache-read-only == 'false' }}
45+
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
3146
with:
3247
cache-read-only: false
3348
develocity-access-key: ${{ inputs.develocity-access-key }}
49+
- name: Set Up Gradle
50+
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
51+
with:
52+
develocity-access-key: ${{ inputs.develocity-access-key }}
53+
develocity-token-expiry: 4
3454
- name: Configure Gradle Properties
3555
shell: bash
3656
run: |
3757
mkdir -p $HOME/.gradle
3858
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
3959
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
4060
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
41-
echo 'org.gradle.daemon=4' >> $HOME/.gradle/gradle.properties
4261
- name: Configure Toolchain Properties
4362
if: ${{ inputs.java-toolchain == 'true' }}
4463
shell: bash
+17-11
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
name: Send Notification
2-
description: Sends a Google Chat message as a notification of the job's outcome
2+
description: 'Sends a Google Chat message as a notification of the job''s outcome'
33
inputs:
4-
webhook-url:
5-
description: 'Google Chat Webhook URL'
6-
required: true
7-
status:
8-
description: 'Status of the job'
9-
required: true
104
build-scan-url:
115
description: 'URL of the build scan to include in the notification'
6+
required: false
127
run-name:
138
description: 'Name of the run to include in the notification'
9+
required: false
1410
default: ${{ format('{0} {1}', github.ref_name, github.job) }}
11+
status:
12+
description: 'Status of the job'
13+
required: true
14+
webhook-url:
15+
description: 'Google Chat Webhook URL'
16+
required: true
1517
runs:
1618
using: composite
1719
steps:
18-
- shell: bash
20+
- name: Prepare Variables
21+
shell: bash
1922
run: |
2023
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
2124
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV"
22-
- shell: bash
25+
- name: Success Notification
2326
if: ${{ inputs.status == 'success' }}
27+
shell: bash
2428
run: |
2529
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true
26-
- shell: bash
30+
- name: Failure Notification
2731
if: ${{ inputs.status == 'failure' }}
32+
shell: bash
2833
run: |
2934
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true
30-
- shell: bash
35+
- name: Cancel Notification
3136
if: ${{ inputs.status == 'cancelled' }}
37+
shell: bash
3238
run: |
3339
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true

.github/actions/sync-to-maven-central/action.yml

+7-14
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ inputs:
44
jfrog-cli-config-token:
55
description: 'Config token for the JFrog CLI'
66
required: true
7-
spring-graphql-version:
8-
description: 'The version of Spring GraphQL that is being synced to Central'
9-
required: true
107
ossrh-s01-token-username:
118
description: 'Username for authentication with s01.oss.sonatype.org'
129
required: true
@@ -16,11 +13,14 @@ inputs:
1613
ossrh-s01-staging-profile:
1714
description: 'Staging profile to use when syncing to Central'
1815
required: true
16+
spring-graphql-version:
17+
description: 'The version of Spring GraphQL that is being synced to Central'
18+
required: true
1919
runs:
2020
using: composite
2121
steps:
2222
- name: Set Up JFrog CLI
23-
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2
23+
uses: jfrog/setup-jfrog-cli@18e785fb220d332edbf01964f853ff0fcaa22220 # v4.4.2
2424
env:
2525
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
2626
- name: Download Release Artifacts
@@ -38,13 +38,6 @@ runs:
3838
release: true
3939
generate-checksums: true
4040
- name: Await
41-
shell: bash
42-
run: |
43-
url=${{ format('https://repo.maven.apache.org/maven2/org/springframework/graphql/spring-graphql/{0}/spring-graphql-{0}.jar', inputs.spring-graphql-version) }}
44-
echo "Waiting for $url"
45-
until curl --fail --head --silent $url > /dev/null
46-
do
47-
echo "."
48-
sleep 60
49-
done
50-
echo "$url is available"
41+
uses: ./.github/actions/await-http-resource
42+
with:
43+
url: ${{ format('https://repo.maven.apache.org/maven2/org/springframework/graphql/spring-graphql/{0}/spring-graphql-{0}.jar', inputs.spring-graphql-version) }}

.github/workflows/delete-staged-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Set up JFrog CLI
14-
uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
14+
uses: jfrog/setup-jfrog-cli@18e785fb220d332edbf01964f853ff0fcaa22220 # v4.4.2
1515
env:
1616
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
1717
- name: Delete Build

0 commit comments

Comments
 (0)