Skip to content

Commit 80809bb

Browse files
committed
Move CI to GitHub Actions
Closes gh-32447
1 parent 6d323d7 commit 80809bb

13 files changed

+197
-171
lines changed

Diff for: .github/actions/send-notification/action.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Send notification
2+
description: Sends a Google Chat message as a notification of the job's outcome
3+
inputs:
4+
webhook-url:
5+
description: 'Google Chat Webhook URL'
6+
required: true
7+
status:
8+
description: 'Status of the job'
9+
required: true
10+
build-scan-url:
11+
description: 'URL of the build scan to include in the notification'
12+
run-name:
13+
description: 'Name of the run to include in the notification'
14+
default: ${{ format('{0} {1}', github.ref_name, github.job) }}
15+
runs:
16+
using: composite
17+
steps:
18+
- shell: bash
19+
run: |
20+
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
21+
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV"
22+
- shell: bash
23+
if: ${{ inputs.status == 'success' }}
24+
run: |
25+
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
27+
if: ${{ inputs.status == 'failure' }}
28+
run: |
29+
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
31+
if: ${{ inputs.status == 'cancelled' }}
32+
run: |
33+
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true

Diff for: .github/workflows/build-and-deploy-snapshot.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and deploy snapshot
2+
on:
3+
push:
4+
branches:
5+
- 6.0.x
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
jobs:
9+
build-and-deploy-snapshot:
10+
if: ${{ github.repository == 'spring-projects/spring-framework' }}
11+
name: Build and deploy snapshot
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Java
15+
uses: actions/setup-java@v4
16+
with:
17+
distribution: 'liberica'
18+
java-version: 17
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
- name: Set up Gradle
22+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
23+
with:
24+
cache-read-only: false
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+
echo 'org.gradle.daemon=4' >> $HOME/.gradle/gradle.properties
33+
- name: Build and publish
34+
id: build
35+
env:
36+
CI: 'true'
37+
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
38+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
39+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
40+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
41+
run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository build publishAllPublicationsToDeploymentRepository
42+
- name: Deploy
43+
uses: spring-io/[email protected]
44+
with:
45+
uri: 'https://repo.spring.io'
46+
username: ${{ secrets.ARTIFACTORY_USERNAME }}
47+
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
48+
build-name: ${{ format('spring-framework-{0}', github.ref_name)}}
49+
repository: 'libs-snapshot-local'
50+
folder: 'deployment-repository'
51+
signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
52+
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
53+
artifact-properties: |
54+
/**/framework-api-*.zip::zip.name=spring-framework,zip.deployed=false
55+
/**/framework-api-*-docs.zip::zip.type=docs
56+
/**/framework-api-*-schema.zip::zip.type=schema
57+
- name: Send notification
58+
uses: ./.github/actions/send-notification
59+
if: always()
60+
with:
61+
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
62+
status: ${{ job.status }}
63+
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
64+
run-name: ${{ format('{0} | Linux | Java 17', github.ref_name) }}

Diff for: .github/workflows/ci.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- 6.0.x
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
jobs:
9+
ci:
10+
if: ${{ github.repository == 'spring-projects/spring-framework' }}
11+
strategy:
12+
matrix:
13+
os:
14+
- id: ubuntu-latest
15+
name: Linux
16+
java:
17+
- version: 17
18+
toolchain: false
19+
- version: 21
20+
toolchain: true
21+
exclude:
22+
- os:
23+
name: Linux
24+
java:
25+
version: 17
26+
name: '${{ matrix.os.name}} | Java ${{ matrix.java.version}}'
27+
runs-on: ${{ matrix.os.id }}
28+
steps:
29+
- name: Set up Java
30+
uses: actions/setup-java@v4
31+
with:
32+
distribution: 'liberica'
33+
java-version: |
34+
${{ matrix.java.version }}
35+
${{ matrix.java.toolchain && '17' || '' }}
36+
- name: Prepare Windows runner
37+
if: ${{ runner.os == 'Windows' }}
38+
run: |
39+
git config --global core.autocrlf true
40+
git config --global core.longPaths true
41+
Stop-Service -name Docker
42+
- name: Check out code
43+
uses: actions/checkout@v4
44+
- name: Set up Gradle
45+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
46+
with:
47+
cache-read-only: false
48+
- name: Configure Gradle properties
49+
shell: bash
50+
run: |
51+
mkdir -p $HOME/.gradle
52+
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
53+
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
54+
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
55+
echo 'org.gradle.daemon=4' >> $HOME/.gradle/gradle.properties
56+
- name: Configure toolchain properties
57+
if: ${{ matrix.java.toolchain }}
58+
shell: bash
59+
run: |
60+
echo toolchainVersion=${{ matrix.java.version }} >> $HOME/.gradle/gradle.properties
61+
echo systemProp.org.gradle.java.installations.auto-detect=false >> $HOME/.gradle/gradle.properties
62+
echo systemProp.org.gradle.java.installations.auto-download=false >> $HOME/.gradle/gradle.properties
63+
echo systemProp.org.gradle.java.installations.paths=${{ format('$JAVA_HOME_{0}_X64', matrix.java.version) }} >> $HOME/.gradle/gradle.properties
64+
- name: Build
65+
id: build
66+
env:
67+
CI: 'true'
68+
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
69+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
70+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
71+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
72+
run: ./gradlew check antora
73+
- name: Send notification
74+
uses: ./.github/actions/send-notification
75+
if: always()
76+
with:
77+
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
78+
status: ${{ job.status }}
79+
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
80+
run-name: ${{ format('{0} | {1} | Java {2}', github.ref_name, matrix.os.name, matrix.java.version) }}

Diff for: .github/workflows/deploy-docs.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: Deploy Docs
22
on:
33
push:
4-
branches-ignore: [ gh-pages ]
5-
tags: '**'
4+
branches:
5+
- 'main'
6+
- '*.x'
7+
- '!gh-pages'
8+
tags:
9+
- 'v*'
610
repository_dispatch:
711
types: request-build-reference # legacy
8-
schedule:
9-
- cron: '0 10 * * *' # Once per day at 10am UTC
1012
workflow_dispatch:
1113
permissions:
1214
actions: write

Diff for: ci/README.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
== Spring Framework Concourse pipeline
22

3+
NOTE: CI is being migrated to GitHub Actions.
4+
35
The Spring Framework uses https://concourse-ci.org/[Concourse] for its CI build and other automated tasks.
46
The Spring team has a dedicated Concourse instance available at https://ci.spring.io with a build pipeline
57
for https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-6.0.x[Spring Framework 6.0.x].

Diff for: ci/parameters.yml

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ milestone: "6.0.x"
88
build-name: "spring-framework"
99
pipeline-name: "spring-framework"
1010
concourse-url: "https://ci.spring.io"
11-
task-timeout: 1h00m

Diff for: ci/pipeline.yml

+12-75
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ anchors:
2323
docker-resource-source: &docker-resource-source
2424
username: ((docker-hub-username))
2525
password: ((docker-hub-password))
26-
slack-fail-params: &slack-fail-params
27-
text: >
28-
:concourse-failed: <https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}|${BUILD_PIPELINE_NAME} ${BUILD_JOB_NAME} failed!>
29-
[$TEXT_FILE_CONTENT]
30-
text_file: git-repo/build/build-scan-uri.txt
31-
silent: true
32-
icon_emoji: ":concourse:"
33-
username: concourse-ci
3426
changelog-task-params: &changelog-task-params
3527
name: generated-changelog/tag
3628
tag: generated-changelog/tag
@@ -64,12 +56,6 @@ resource_types:
6456
<<: *docker-resource-source
6557
repository: dpb587/github-status-resource
6658
tag: master
67-
- name: slack-notification
68-
type: registry-image
69-
source:
70-
<<: *docker-resource-source
71-
repository: cfcommunity/slack-notification-resource
72-
tag: latest
7359
resources:
7460
- name: git-repo
7561
type: git
@@ -98,19 +84,6 @@ resources:
9884
username: ((artifactory-username))
9985
password: ((artifactory-password))
10086
build_name: ((build-name))
101-
- name: repo-status-build
102-
type: github-status-resource
103-
icon: eye-check-outline
104-
source:
105-
repository: ((github-repo-name))
106-
access_token: ((github-ci-status-token))
107-
branch: ((branch))
108-
context: build
109-
- name: slack-alert
110-
type: slack-notification
111-
icon: slack
112-
source:
113-
url: ((slack-webhook-url))
11487
- name: github-pre-release
11588
type: github-release
11689
icon: briefcase-download-outline
@@ -145,37 +118,23 @@ jobs:
145118
- put: ci-image
146119
params:
147120
image: ci-image/image.tar
148-
- name: build
121+
- name: stage-milestone
149122
serial: true
150-
public: true
151123
plan:
152124
- get: ci-image
153125
- get: git-repo
154-
trigger: true
155-
- put: repo-status-build
156-
params: { state: "pending", commit: "git-repo" }
157-
- do:
158-
- task: build-project
159-
image: ci-image
160-
file: git-repo/ci/tasks/build-project.yml
161-
privileged: true
162-
timeout: ((task-timeout))
163-
params:
164-
<<: *build-project-task-params
165-
on_failure:
166-
do:
167-
- put: repo-status-build
168-
params: { state: "failure", commit: "git-repo" }
169-
- put: slack-alert
170-
params:
171-
<<: *slack-fail-params
172-
- put: repo-status-build
173-
params: { state: "success", commit: "git-repo" }
126+
trigger: false
127+
- task: stage
128+
image: ci-image
129+
file: git-repo/ci/tasks/stage-version.yml
130+
params:
131+
RELEASE_TYPE: M
132+
<<: *gradle-enterprise-task-params
174133
- put: artifactory-repo
175134
params: &artifactory-params
176135
signing_key: ((signing-key))
177136
signing_passphrase: ((signing-passphrase))
178-
repo: libs-snapshot-local
137+
repo: libs-staging-local
179138
folder: distribution-repository
180139
build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}"
181140
build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}"
@@ -200,27 +159,9 @@ jobs:
200159
- "/**/framework-docs-*-schema.zip"
201160
properties:
202161
"zip.type": "schema"
203-
get_params:
204-
threads: 8
205-
- name: stage-milestone
206-
serial: true
207-
plan:
208-
- get: ci-image
209-
- get: git-repo
210-
trigger: false
211-
- task: stage
212-
image: ci-image
213-
file: git-repo/ci/tasks/stage-version.yml
214-
params:
215-
RELEASE_TYPE: M
216-
<<: *gradle-enterprise-task-params
217-
- put: artifactory-repo
218-
params:
219-
<<: *artifactory-params
220-
repo: libs-staging-local
221-
- put: git-repo
222-
params:
223-
repository: stage-git-repo
162+
- put: git-repo
163+
params:
164+
repository: stage-git-repo
224165
- name: promote-milestone
225166
serial: true
226167
plan:
@@ -262,7 +203,6 @@ jobs:
262203
- put: artifactory-repo
263204
params:
264205
<<: *artifactory-params
265-
repo: libs-staging-local
266206
- put: git-repo
267207
params:
268208
repository: stage-git-repo
@@ -307,7 +247,6 @@ jobs:
307247
- put: artifactory-repo
308248
params:
309249
<<: *artifactory-params
310-
repo: libs-staging-local
311250
- put: git-repo
312251
params:
313252
repository: stage-git-repo
@@ -352,8 +291,6 @@ jobs:
352291
<<: *changelog-task-params
353292

354293
groups:
355-
- name: "builds"
356-
jobs: ["build"]
357294
- name: "releases"
358295
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"]
359296
- name: "ci-images"

Diff for: ci/scripts/build-pr.sh

-8
This file was deleted.

Diff for: ci/scripts/build-project.sh

-9
This file was deleted.

Diff for: ci/scripts/check-project.sh

-9
This file was deleted.

0 commit comments

Comments
 (0)