Skip to content

Commit b728040

Browse files
committed
Move CI and snapshot deployment to GitHub actions
Closes gh-32436
1 parent a334592 commit b728040

File tree

12 files changed

+180
-96
lines changed

12 files changed

+180
-96
lines changed
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
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.1.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) }}

.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.1.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) }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# <img src="framework-docs/src/docs/spring-framework.png" width="80" height="80"> Spring Framework [![Build Status](https://ci.spring.io/api/v1/teams/spring-framework/pipelines/spring-framework-6.1.x/jobs/build/badge)](https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-6.1.x?groups=Build") [![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.spring.io/scans?search.rootProjectNames=spring)
1+
# <img src="framework-docs/src/docs/spring-framework.png" width="80" height="80"> Spring Framework [![Build Status](https://github.com/spring-projects/spring-framework/actions/workflows/build-and-deploy-snapshot.yml/badge.svg?branch=6.1.x)](https://github.com/spring-projects/spring-framework/actions/workflows/build-and-deploy-snapshot.yml?query=branch%3A6.1.x) [![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.spring.io/scans?search.rootProjectNames=spring)
22

33
This is the home of the Spring Framework: the foundation for all [Spring projects](https://spring.io/projects). Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".
44

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.1.x[Spring Framework 6.1.x].

ci/pipeline.yml

-2
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,6 @@ jobs:
427427
<<: *changelog-task-params
428428

429429
groups:
430-
- name: "builds"
431-
jobs: ["build", "jdk21-build", "jdk23-build"]
432430
- name: "releases"
433431
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"]
434432
- name: "ci-images"

ci/scripts/build-pr.sh

-9
This file was deleted.

ci/scripts/build-project.sh

-10
This file was deleted.

ci/scripts/check-project.sh

-9
This file was deleted.

ci/tasks/build-pr.yml

-19
This file was deleted.

ci/tasks/build-project.yml

-22
This file was deleted.

ci/tasks/check-project.yml

-24
This file was deleted.

0 commit comments

Comments
 (0)