Skip to content

Commit 5f534e6

Browse files
committed
Merge branch '6.2.x'
2 parents fd3de41 + 3f2d86f commit 5f534e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+141
-5531
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 71 additions & 262 deletions
Large diffs are not rendered by default.

.github/workflows/update-scheduled-release-version.yml

Lines changed: 4 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -3,78 +3,11 @@ name: Update Scheduled Release Version
33
on:
44
workflow_dispatch: # Manual trigger only. Triggered by release-scheduler.yml on main.
55

6-
env:
7-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
8-
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
9-
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
10-
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
11-
126
permissions:
137
contents: read
148

159
jobs:
16-
update_scheduled_release_version:
17-
name: Initiate Release If Scheduled
18-
if: ${{ github.repository == 'spring-projects/spring-security' }}
19-
runs-on: ubuntu-latest
20-
permissions:
21-
contents: read
22-
actions: read
23-
steps:
24-
- id: checkout-source
25-
name: Checkout Source Code
26-
uses: actions/checkout@v4
27-
with:
28-
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
29-
- name: Set up gradle
30-
uses: spring-io/spring-gradle-build-action@v2
31-
with:
32-
java-version: '17'
33-
distribution: 'temurin'
34-
- id: check-release-due
35-
name: Check Release Due
36-
run: |
37-
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
38-
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
39-
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
40-
./gradlew gitHubCheckNextVersionDueToday
41-
echo "is_due_today=$(cat build/github/milestones/is-due-today)" >>$GITHUB_OUTPUT
42-
- id: check-open-issues
43-
name: Check for open issues
44-
if: steps.check-release-due.outputs.is_due_today == 'true'
45-
run: |
46-
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
47-
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
48-
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
49-
./gradlew gitHubCheckMilestoneHasNoOpenIssues
50-
echo "is_open_issues=$(cat build/github/milestones/is-open-issues)" >>$GITHUB_OUTPUT
51-
- id: validate-release-state
52-
name: Validate State of Release
53-
if: steps.check-release-due.outputs.is_due_today == 'true' && steps.check-open-issues.outputs.is_open_issues == 'true'
54-
run: |
55-
echo "The release is due today but there are open issues"
56-
exit 1
57-
- id: update-version-and-push
58-
name: Update version and push
59-
if: steps.check-release-due.outputs.is_due_today == 'true' && steps.check-open-issues.outputs.is_open_issues == 'false'
60-
run: |
61-
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
62-
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
63-
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
64-
git config user.name 'github-actions[bot]'
65-
git config user.email 'github-actions[bot]@users.noreply.github.com'
66-
./gradlew :updateProjectVersion
67-
updatedVersion=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}')
68-
git commit -am "Release $updatedVersion"
69-
git tag $updatedVersion
70-
git push
71-
git push origin $updatedVersion
72-
- id: send-slack-notification
73-
name: Send Slack message
74-
if: failure()
75-
uses: Gamesight/slack-workflow-status@v1.2.0
76-
with:
77-
repo_token: ${{ secrets.GITHUB_TOKEN }}
78-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
79-
channel: '#spring-security-ci'
80-
name: 'CI Notifier'
10+
update-scheduled-release-version:
11+
name: Update Scheduled Release Version
12+
uses: spring-io/spring-security-release-tools/.github/workflows/update-scheduled-release-version.yml@v1
13+
secrets: inherit

build.gradle

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@ apply plugin: 'locks'
2323
apply plugin: 's101'
2424
apply plugin: 'io.spring.convention.root'
2525
apply plugin: 'org.jetbrains.kotlin.jvm'
26-
apply plugin: 'org.springframework.security.update-version'
27-
apply plugin: 'org.springframework.security.sagan'
28-
apply plugin: 'org.springframework.github.milestone'
29-
apply plugin: 'org.springframework.github.changelog'
30-
apply plugin: 'org.springframework.github.release'
3126
apply plugin: 'org.springframework.security.versions.verify-dependencies-versions'
27+
apply plugin: 'io.spring.security.release'
3228

3329
group = 'org.springframework.security'
3430
description = 'Spring Security'
@@ -42,53 +38,12 @@ repositories {
4238
maven { url "https://repo.spring.io/milestone" }
4339
}
4440

45-
tasks.named("saganCreateRelease") {
46-
referenceDocUrl = "https://docs.spring.io/spring-security/reference/{version}/index.html"
47-
apiDocUrl = "https://docs.spring.io/spring-security/site/docs/{version}/api/"
48-
}
49-
50-
tasks.named("gitHubCheckMilestoneHasNoOpenIssues") {
51-
repository {
52-
owner = "spring-projects"
53-
name = "spring-security"
54-
}
55-
}
56-
57-
tasks.named("gitHubNextReleaseMilestone") {
58-
repository {
59-
owner = "spring-projects"
60-
name = "spring-security"
61-
}
62-
}
63-
64-
tasks.named("gitHubCheckNextVersionDueToday") {
65-
repository {
66-
owner = "spring-projects"
67-
name = "spring-security"
68-
}
69-
}
70-
71-
tasks.named("scheduleNextRelease") {
72-
repository {
73-
owner = "spring-projects"
74-
name = "spring-security"
75-
}
41+
springRelease {
7642
weekOfMonth = 3
7743
dayOfWeek = 1
78-
}
79-
80-
tasks.named("createGitHubRelease") {
81-
repository {
82-
owner = "spring-projects"
83-
name = "spring-security"
84-
}
85-
}
86-
87-
tasks.named("dispatchGitHubWorkflow") {
88-
repository {
89-
owner = "spring-projects"
90-
name = "spring-security"
91-
}
44+
referenceDocUrl = "https://docs.spring.io/spring-security/reference/{version}/index.html"
45+
apiDocUrl = "https://docs.spring.io/spring-security/docs/{version}/api/"
46+
replaceSnapshotVersionInReferenceDocUrl = true
9247
}
9348

9449
def toolchainVersion() {

buildSrc/build.gradle

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ sourceSets {
2727

2828
gradlePlugin {
2929
plugins {
30-
checkAntoraVersion {
31-
id = "org.springframework.antora.check-version"
32-
implementationClass = "org.springframework.gradle.antora.AntoraVersionPlugin"
33-
}
3430
trang {
3531
id = "trang"
3632
implementationClass = "trang.TrangPlugin"
@@ -43,26 +39,6 @@ gradlePlugin {
4339
id = "io.spring.convention.management-configuration"
4440
implementationClass = "io.spring.gradle.convention.ManagementConfigurationPlugin"
4541
}
46-
updateProjectVersion {
47-
id = "org.springframework.security.update-version"
48-
implementationClass = "org.springframework.security.convention.versions.UpdateProjectVersionPlugin"
49-
}
50-
sagan {
51-
id = "org.springframework.security.sagan"
52-
implementationClass = "org.springframework.gradle.sagan.SaganPlugin"
53-
}
54-
githubMilestone {
55-
id = "org.springframework.github.milestone"
56-
implementationClass = "org.springframework.gradle.github.milestones.GitHubMilestonePlugin"
57-
}
58-
githubChangelog {
59-
id = "org.springframework.github.changelog"
60-
implementationClass = "org.springframework.gradle.github.changelog.GitHubChangelogPlugin"
61-
}
62-
githubRelease {
63-
id = "org.springframework.github.release"
64-
implementationClass = "org.springframework.gradle.github.release.GitHubReleasePlugin"
65-
}
6642
s101 {
6743
id = "s101"
6844
implementationClass = "s101.S101Plugin"
@@ -96,11 +72,14 @@ dependencies {
9672
implementation libs.com.github.spullara.mustache.java.compiler
9773
implementation libs.io.spring.javaformat.spring.javaformat.gradle.plugin
9874
implementation libs.io.spring.nohttp.nohttp.gradle
99-
implementation libs.net.sourceforge.htmlunit
75+
implementation (libs.net.sourceforge.htmlunit) {
76+
exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
77+
}
10078
implementation libs.org.hidetake.gradle.ssh.plugin
10179
implementation libs.org.jfrog.buildinfo.build.info.extractor.gradle
10280
implementation libs.org.sonarsource.scanner.gradle.sonarqube.gradle.plugin
10381
implementation libs.com.squareup.okhttp3.okhttp
82+
implementation libs.io.spring.security.release.plugin
10483

10584
testImplementation platform(libs.org.junit.junit.bom)
10685
testImplementation platform(libs.org.mockito.mockito.bom)

buildSrc/src/main/groovy/io/spring/gradle/convention/ArtifactoryPlugin.groovy

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ class ArtifactoryPlugin implements Plugin<Project> {
2929

3030
private static final String ARTIFACTORY_RELEASE_REPOSITORY = "ARTIFACTORY_RELEASE_REPOSITORY"
3131

32+
private static final String ARTIFACTORY_PROJECT_KEY = "ARTIFACTORY_PROJECT_KEY"
33+
34+
private static final String ARTIFACTORY_BUILD_NAME = "ARTIFACTORY_BUILD_NAME"
35+
36+
private static final String ARTIFACTORY_BUILD_NUMBER = "ARTIFACTORY_BUILD_NUMBER"
37+
38+
private static final String ARTIFACTORY_BUILD_URL = "ARTIFACTORY_BUILD_URL"
39+
40+
private static final String ARTIFACTORY_BUILD_AGENT_NAME = "ARTIFACTORY_BUILD_AGENT_NAME"
41+
42+
private static final String ARTIFACTORY_BUILD_AGENT_VERSION = "ARTIFACTORY_BUILD_AGENT_VERSION"
43+
44+
private static final String ARTIFACTORY_USER_AGENT_NAME = "ARTIFACTORY_USER_AGENT_NAME"
45+
46+
private static final String ARTIFACTORY_USER_AGENT_VERSION = "ARTIFACTORY_USER_AGENT_VERSION"
47+
48+
private static final String ARTIFACTORY_VCS_REVISION = "ARTIFACTORY_VCS_REVISION"
49+
3250
private static final String DEFAULT_ARTIFACTORY_URL = "https://repo.spring.io"
3351

3452
private static final String DEFAULT_ARTIFACTORY_SNAPSHOT_REPOSITORY = "libs-snapshot-local"
@@ -48,6 +66,15 @@ class ArtifactoryPlugin implements Plugin<Project> {
4866
String snapshotRepository = env.getOrDefault(ARTIFACTORY_SNAPSHOT_REPOSITORY, DEFAULT_ARTIFACTORY_SNAPSHOT_REPOSITORY)
4967
String milestoneRepository = env.getOrDefault(ARTIFACTORY_MILESTONE_REPOSITORY, DEFAULT_ARTIFACTORY_MILESTONE_REPOSITORY)
5068
String releaseRepository = env.getOrDefault(ARTIFACTORY_RELEASE_REPOSITORY, DEFAULT_ARTIFACTORY_RELEASE_REPOSITORY)
69+
String projectKey = env.get(ARTIFACTORY_PROJECT_KEY)
70+
String buildName = env.get(ARTIFACTORY_BUILD_NAME)
71+
String buildNumber = env.get(ARTIFACTORY_BUILD_NUMBER)
72+
String buildUrl = env.get(ARTIFACTORY_BUILD_URL)
73+
String buildAgentName = env.get(ARTIFACTORY_BUILD_AGENT_NAME)
74+
String buildAgentVersion = env.get(ARTIFACTORY_BUILD_AGENT_VERSION)
75+
String userAgentName = env.get(ARTIFACTORY_USER_AGENT_NAME)
76+
String userAgentVersion = env.get(ARTIFACTORY_USER_AGENT_VERSION)
77+
String vcsRevision = env.get(ARTIFACTORY_VCS_REVISION)
5178
project.artifactory {
5279
contextUrl = artifactoryUrl
5380
publish {
@@ -59,6 +86,35 @@ class ArtifactoryPlugin implements Plugin<Project> {
5986
}
6087
}
6188
}
89+
90+
def buildInfo = clientConfig.info
91+
if (projectKey != null) {
92+
buildInfo.setProject(projectKey)
93+
}
94+
if (buildName != null) {
95+
buildInfo.setBuildName(buildName)
96+
}
97+
if (buildNumber != null) {
98+
buildInfo.setBuildNumber(buildNumber)
99+
}
100+
if (buildUrl != null) {
101+
buildInfo.setBuildUrl(buildUrl)
102+
}
103+
if (buildAgentName != null) {
104+
buildInfo.setBuildAgentName(buildAgentName)
105+
}
106+
if (buildAgentVersion != null) {
107+
buildInfo.setBuildAgentVersion(buildAgentVersion)
108+
}
109+
if (userAgentName != null) {
110+
buildInfo.setAgentName(userAgentName)
111+
}
112+
if (userAgentVersion != null) {
113+
buildInfo.setAgentVersion(userAgentVersion)
114+
}
115+
if (vcsRevision != null) {
116+
buildInfo.setVcsRevision(vcsRevision)
117+
}
62118
}
63119
project.plugins.withType(MavenPublishPlugin) {
64120
project.artifactory {

buildSrc/src/main/java/org/springframework/gradle/antora/AntoraVersionPlugin.java

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)