Skip to content

Commit 09680e1

Browse files
committed
Migrate all workflows to GitHub Actions
This commit completes the migration from Concourse to GitHub Actions, adding the CI variants and release workflows. Closes gh-1024
1 parent a6508f4 commit 09680e1

30 files changed

+348
-783
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: 'Build'
2+
description: 'Builds the project, optionally publishing it to a local deployment repository'
3+
inputs:
4+
java-version:
5+
required: false
6+
default: '17'
7+
description: 'The Java version to compile and test with'
8+
java-distribution:
9+
required: false
10+
default: 'liberica'
11+
description: 'The Java distribution to use for the build'
12+
java-toolchain:
13+
required: false
14+
default: 'false'
15+
description: 'Whether a Java toolchain should be used'
16+
publish:
17+
required: false
18+
default: 'false'
19+
description: 'Whether to publish artifacts ready for deployment to Artifactory'
20+
develocity-access-key:
21+
required: false
22+
description: 'The access key for authentication with ge.spring.io'
23+
outputs:
24+
build-scan-url:
25+
description: 'The URL, if any, of the build scan produced by the build'
26+
value: ${{ (inputs.publish == 'true' && steps.publish.outputs.build-scan-url) || steps.build.outputs.build-scan-url }}
27+
version:
28+
description: 'The version that was built'
29+
value: ${{ steps.read-version.outputs.version }}
30+
runs:
31+
using: composite
32+
steps:
33+
- name: Prepare Gradle Build
34+
uses: ./.github/actions/prepare-gradle-build
35+
with:
36+
develocity-access-key: ${{ inputs.develocity-access-key }}
37+
java-version: ${{ inputs.java-version }}
38+
java-distribution: ${{ inputs.java-distribution }}
39+
java-toolchain: ${{ inputs.java-toolchain }}
40+
- name: Build
41+
id: build
42+
if: ${{ inputs.publish == 'false' }}
43+
shell: bash
44+
run: ./gradlew check antora
45+
- name: Publish
46+
id: publish
47+
if: ${{ inputs.publish == 'true' }}
48+
shell: bash
49+
run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository build publishAllPublicationsToDeploymentRepository
50+
- name: Read Version From gradle.properties
51+
id: read-version
52+
shell: bash
53+
run: |
54+
version=$(sed -n 's/version=\(.*\)/\1/p' gradle.properties)
55+
echo "Version is $version"
56+
echo "version=$version" >> $GITHUB_OUTPUT
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Create GitHub Release
2+
description: Create the release on GitHub with a changelog
3+
inputs:
4+
milestone:
5+
description: 'Name of the GitHub milestone for which a release will be created'
6+
required: true
7+
token:
8+
description: 'Token to use for authentication with GitHub'
9+
required: true
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Generate Changelog
14+
uses: spring-io/github-changelog-generator@185319ad7eaa75b0e8e72e4b6db19c8b2cb8c4c1 #v0.0.11
15+
with:
16+
milestone: ${{ inputs.milestone }}
17+
token: ${{ inputs.token }}
18+
config-file: .github/actions/create-github-release/changelog-generator.yml
19+
- name: Create GitHub Release
20+
env:
21+
GITHUB_TOKEN: ${{ inputs.token }}
22+
shell: bash
23+
run: gh release create ${{ format('v{0}', inputs.milestone) }} --notes-file changelog.md

ci/config/changelog-generator.yml renamed to .github/actions/create-github-release/changelog-generator.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ changelog:
44
- title: ":star: New Features"
55
labels:
66
- "type: enhancement"
7-
- title: ":beetle: Bug Fixes"
7+
- title: ":lady_beetle: Bug Fixes"
88
labels:
99
- "type: bug"
1010
- "type: regression"
@@ -15,3 +15,8 @@ changelog:
1515
sort: "title"
1616
labels:
1717
- "type: dependency-upgrade"
18+
contributors:
19+
exclude:
20+
names:
21+
- "bclozel"
22+
- "rstoyanchev"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 'Prepare Gradle Build'
2+
description: 'Prepares a Gradle build. Sets up Java and Gradle and configures Gradle properties'
3+
inputs:
4+
java-version:
5+
required: false
6+
default: '17'
7+
description: 'The Java version to use for the build'
8+
java-distribution:
9+
required: false
10+
default: 'liberica'
11+
description: 'The Java distribution to use for the build'
12+
java-toolchain:
13+
required: false
14+
default: 'false'
15+
description: 'Whether a Java toolchain should be used'
16+
develocity-access-key:
17+
required: false
18+
description: 'The access key for authentication with ge.spring.io'
19+
runs:
20+
using: composite
21+
steps:
22+
- name: Set Up Java
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: ${{ inputs.java-distribution }}
26+
java-version: |
27+
${{ inputs.java-version }}
28+
${{ inputs.java-toolchain == 'true' && '17' || '' }}
29+
- name: Set Up Gradle
30+
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
31+
with:
32+
cache-read-only: false
33+
develocity-access-key: ${{ inputs.develocity-access-key }}
34+
- name: Configure Gradle Properties
35+
shell: bash
36+
run: |
37+
mkdir -p $HOME/.gradle
38+
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
39+
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
40+
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
41+
echo 'org.gradle.daemon=4' >> $HOME/.gradle/gradle.properties
42+
- name: Configure Toolchain Properties
43+
if: ${{ inputs.java-toolchain == 'true' }}
44+
shell: bash
45+
run: |
46+
echo toolchainVersion=${{ inputs.java-version }} >> $HOME/.gradle/gradle.properties
47+
echo systemProp.org.gradle.java.installations.auto-detect=false >> $HOME/.gradle/gradle.properties
48+
echo systemProp.org.gradle.java.installations.auto-download=false >> $HOME/.gradle/gradle.properties
49+
echo systemProp.org.gradle.java.installations.paths=${{ format('$JAVA_HOME_{0}_X64', inputs.java-version) }} >> $HOME/.gradle/gradle.properties

.github/actions/send-notification/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Send notification
1+
name: Send Notification
22
description: Sends a Google Chat message as a notification of the job's outcome
33
inputs:
44
webhook-url:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Sync to Maven Central
2+
description: Syncs a release to Maven Central and waits for it to be available for use
3+
inputs:
4+
jfrog-cli-config-token:
5+
description: 'Config token for the JFrog CLI'
6+
required: true
7+
spring-graphql-version:
8+
description: 'The version of Spring GraphQL that is being synced to Central'
9+
required: true
10+
ossrh-s01-token-username:
11+
description: 'Username for authentication with s01.oss.sonatype.org'
12+
required: true
13+
ossrh-s01-token-password:
14+
description: 'Password for authentication with s01.oss.sonatype.org'
15+
required: true
16+
ossrh-s01-staging-profile:
17+
description: 'Staging profile to use when syncing to Central'
18+
required: true
19+
runs:
20+
using: composite
21+
steps:
22+
- name: Set Up JFrog CLI
23+
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2
24+
env:
25+
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
26+
- name: Download Release Artifacts
27+
shell: bash
28+
run: jf rt download --spec ${{ format('{0}/artifacts.spec', github.action_path) }} --spec-vars 'buildName=${{ format('spring-graphql-{0}', inputs.spring-graphql-version) }};buildNumber=${{ github.run_number }}'
29+
- name: Sync
30+
uses: spring-io/nexus-sync-action@42477a2230a2f694f9eaa4643fa9e76b99b7ab84 # v0.0.1
31+
with:
32+
username: ${{ inputs.ossrh-s01-token-username }}
33+
password: ${{ inputs.ossrh-s01-token-password }}
34+
staging-profile-name: ${{ inputs.ossrh-s01-staging-profile }}
35+
create: true
36+
upload: true
37+
close: true
38+
release: true
39+
generate-checksums: true
40+
- 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"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"files": [
3+
{
4+
"aql": {
5+
"items.find": {
6+
"$and": [
7+
{
8+
"@build.name": "${buildName}",
9+
"@build.number": "${buildNumber}",
10+
"path": {
11+
"$nmatch": "org/springframework/graphql/spring-graphql-docs/*"
12+
}
13+
}
14+
]
15+
}
16+
},
17+
"target": "nexus/"
18+
}
19+
]
20+
}

.github/workflows/backport-bot.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ jobs:
1818
pull-requests: write
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-java@v3
21+
- name: Check out code
22+
uses: actions/checkout@v4
23+
- name: Set up Java
24+
uses: actions/setup-java@v4
2325
with:
24-
distribution: 'temurin'
25-
java-version: '17'
26+
distribution: 'liberica'
27+
java-version: 17
2628
- name: Download BackportBot
2729
run: wget https://github.com/spring-io/backport-bot/releases/download/latest/backport-bot-0.0.1-SNAPSHOT.jar
2830
- name: Backport
2931
env:
3032
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3133
GITHUB_EVENT: ${{ toJSON(github.event) }}
32-
run: java -jar backport-bot-0.0.1-SNAPSHOT.jar --github.accessToken="$GITHUB_TOKEN" --github.event_name "$GITHUB_EVENT_NAME" --github.event "$GITHUB_EVENT"
33-
34+
run: java -jar backport-bot-0.0.1-SNAPSHOT.jar --github.accessToken="$GITHUB_TOKEN" --github.event_name "$GITHUB_EVENT_NAME" --github.event "$GITHUB_EVENT"
Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,26 @@
1-
name: Build and deploy snapshot
1+
name: Build and Deploy Snapshot
22
on:
33
push:
44
branches:
55
- 1.2.x
6+
permissions:
7+
actions: write
68
concurrency:
79
group: ${{ github.workflow }}-${{ github.ref }}
810
jobs:
9-
build:
10-
if: ${{ github.repository == 'spring-projects/spring-graphql' }}
11-
name: Build and deploy snapshot
11+
build-and-deploy-snapshot:
12+
name: Build and Deploy Snapshot
1213
runs-on: ubuntu-latest
14+
if: ${{ github.repository == 'spring-projects/spring-graphql' }}
1315
steps:
14-
- name: Set up Java
15-
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
16-
with:
17-
distribution: 'liberica'
18-
java-version: 17
19-
- name: Check out code
20-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21-
- name: Set up Gradle
22-
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
16+
- name: Check Out Code
17+
uses: actions/checkout@v4
18+
- name: Build and Publish
19+
id: build-and-publish
20+
uses: ./.github/actions/build-and-publish
2321
with:
24-
cache-read-only: ${{ github.ref != 'refs/heads/main' || !endsWith(github.ref, '.x') }}
25-
- name: Configure Gradle properties
26-
shell: bash
27-
run: |
28-
mkdir -p $HOME/.gradle
29-
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
30-
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
31-
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
32-
- name: Build and publish
33-
id: build
34-
env:
35-
CI: 'true'
36-
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
37-
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
38-
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
39-
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
40-
run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository build publishAllPublicationsToDeploymentRepository
22+
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
23+
publish: true
4124
- name: Deploy
4225
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
4326
with:
@@ -51,11 +34,13 @@ jobs:
5134
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
5235
artifact-properties: |
5336
/**/spring-graphql-docs-*.zip::zip.name=spring-graphql,zip.type=docs,zip.deployed=false
54-
- name: Send notification
37+
- name: Send Notification
5538
uses: ./.github/actions/send-notification
5639
if: always()
5740
with:
5841
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
5942
status: ${{ job.status }}
60-
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
61-
run-name: ${{ format('{0} | Linux | Java 17', github.ref_name) }}
43+
build-scan-url: ${{ steps.build-and-publish.outputs.build-scan-url }}
44+
run-name: ${{ format('{0} | Linux | Java 17', github.ref_name) }}
45+
outputs:
46+
version: ${{ steps.build-and-publish.outputs.version }}

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- 1.2.x
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
jobs:
9+
ci:
10+
name: '${{ matrix.os.name}} | Java ${{ matrix.java.version}}'
11+
runs-on: ${{ matrix.os.id }}
12+
if: ${{ github.repository == 'spring-projects/spring-graphql' }}
13+
strategy:
14+
matrix:
15+
os:
16+
- id: ubuntu-latest
17+
name: Linux
18+
java:
19+
- version: 21
20+
toolchain: true
21+
- version: 22
22+
toolchain: true
23+
steps:
24+
- name: Check Out Code
25+
uses: actions/checkout@v4
26+
- name: Build
27+
id: build
28+
uses: ./.github/actions/build-and-publish
29+
with:
30+
java-version: ${{ matrix.java.version }}
31+
java-distribution: ${{ matrix.java.distribution || 'liberica' }}
32+
java-toolchain: ${{ matrix.java.toolchain }}
33+
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
34+
- name: Send Notification
35+
uses: ./.github/actions/send-notification
36+
if: always()
37+
with:
38+
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
39+
status: ${{ job.status }}
40+
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
41+
run-name: ${{ format('{0} | {1} | Java {2}', github.ref_name, matrix.os.name, matrix.java.version) }}

0 commit comments

Comments
 (0)