2020-11-10 10:25:16 -05:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-09-29 13:03:04 -04:00
|
|
|
branches-ignore:
|
|
|
|
- "dependabot/**"
|
2020-11-10 10:25:16 -05:00
|
|
|
schedule:
|
|
|
|
- cron: '0 10 * * *' # Once per day at 10am UTC
|
2021-01-21 08:02:54 -05:00
|
|
|
workflow_dispatch: # Manual trigger
|
2020-11-10 10:25:16 -05:00
|
|
|
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
|
|
|
|
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
|
|
|
|
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
|
|
|
|
COMMIT_OWNER: ${{ github.event.pusher.name }}
|
|
|
|
COMMIT_SHA: ${{ github.sha }}
|
2021-10-26 17:10:28 -04:00
|
|
|
STRUCTURE101_LICENSEID: ${{ secrets.STRUCTURE101_LICENSEID }}
|
2020-11-16 14:02:11 -05:00
|
|
|
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
|
|
|
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
2020-11-10 10:25:16 -05:00
|
|
|
|
2022-07-26 16:31:10 -04:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-11-10 10:25:16 -05:00
|
|
|
jobs:
|
2021-05-03 16:12:12 -04:00
|
|
|
prerequisites:
|
|
|
|
name: Pre-requisites for building
|
2020-11-10 10:25:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
2023-10-30 15:15:10 -04:00
|
|
|
if: ${{ github.repository == 'spring-projects/spring-security' }}
|
2021-05-03 16:12:12 -04:00
|
|
|
outputs:
|
|
|
|
runjobs: ${{ steps.continue.outputs.runjobs }}
|
2022-03-09 11:02:18 -05:00
|
|
|
project_version: ${{ steps.continue.outputs.project_version }}
|
2020-11-10 10:25:16 -05:00
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2021-05-03 16:12:12 -04:00
|
|
|
- id: continue
|
|
|
|
name: Determine if should continue
|
2022-03-02 17:16:59 -05:00
|
|
|
run: |
|
|
|
|
# Run jobs if in upstream repository
|
2022-11-24 22:37:39 -05:00
|
|
|
echo "runjobs=true" >>$GITHUB_OUTPUT
|
2022-03-02 17:16:59 -05:00
|
|
|
# Extract version from gradle.properties
|
|
|
|
version=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}')
|
2022-11-24 22:37:39 -05:00
|
|
|
echo "project_version=$version" >>$GITHUB_OUTPUT
|
2021-10-07 14:20:10 -04:00
|
|
|
build_jdk_17:
|
|
|
|
name: Build JDK 17
|
2021-05-03 16:12:12 -04:00
|
|
|
needs: [prerequisites]
|
2021-05-24 11:19:39 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2021-05-07 07:47:47 -04:00
|
|
|
if: needs.prerequisites.outputs.runjobs
|
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-28 13:59:50 -04:00
|
|
|
- name: Set up JDK 17
|
2022-11-24 22:37:39 -05:00
|
|
|
uses: actions/setup-java@v3
|
2021-05-07 07:47:47 -04:00
|
|
|
with:
|
2021-10-07 14:20:10 -04:00
|
|
|
java-version: '17'
|
2022-07-27 12:07:42 -04:00
|
|
|
distribution: 'temurin'
|
2022-12-22 22:13:21 -05:00
|
|
|
cache: 'gradle'
|
2022-07-28 13:59:50 -04:00
|
|
|
- name: Set up Gradle
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
- name: Set up gradle user name
|
|
|
|
run: echo 'systemProp.user.name=spring-builds+github' >> gradle.properties
|
2021-05-14 13:13:18 -04:00
|
|
|
- name: Build with Gradle
|
2021-05-20 08:54:55 -04:00
|
|
|
env:
|
|
|
|
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
|
|
|
|
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
|
|
|
|
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
|
|
|
|
run: ./gradlew clean build --continue -PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD"
|
2020-11-10 10:25:16 -05:00
|
|
|
snapshot_tests:
|
|
|
|
name: Test against snapshots
|
2021-05-03 16:12:12 -04:00
|
|
|
needs: [prerequisites]
|
2023-09-15 10:53:19 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- java-version: '21-ea'
|
|
|
|
toolchain: '21'
|
|
|
|
- java-version: '17'
|
|
|
|
toolchain: '17'
|
2020-11-10 10:25:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-11 18:20:46 -04:00
|
|
|
if: needs.prerequisites.outputs.runjobs
|
2020-11-10 10:25:16 -05:00
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-27 12:07:42 -04:00
|
|
|
- name: Set up gradle
|
|
|
|
uses: spring-io/spring-gradle-build-action@v1
|
2020-11-10 10:25:16 -05:00
|
|
|
with:
|
2023-09-15 10:53:19 -04:00
|
|
|
java-version: ${{ matrix.java-version }}
|
2022-07-27 12:07:42 -04:00
|
|
|
distribution: 'temurin'
|
2020-11-10 10:25:16 -05:00
|
|
|
- name: Snapshot Tests
|
|
|
|
run: |
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
|
|
|
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
2023-09-28 15:02:30 -04:00
|
|
|
./gradlew test --refresh-dependencies -PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD" -PforceMavenRepositories=snapshot -PisOverrideVersionCatalog -PtestToolchain=${{ matrix.toolchain }} -PspringFrameworkVersion='6.1.+' -PreactorVersion='2023.0.+' -PspringDataVersion='2023.1.+' -PlocksDisabled --stacktrace
|
2022-02-14 07:03:41 -05:00
|
|
|
check_samples:
|
|
|
|
name: Check Samples project
|
|
|
|
needs: [prerequisites]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: needs.prerequisites.outputs.runjobs
|
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-27 12:07:42 -04:00
|
|
|
- name: Set up gradle
|
|
|
|
uses: spring-io/spring-gradle-build-action@v1
|
2022-02-14 07:03:41 -05:00
|
|
|
with:
|
|
|
|
java-version: '17'
|
2022-07-27 12:07:42 -04:00
|
|
|
distribution: 'temurin'
|
2022-02-14 07:03:41 -05:00
|
|
|
- name: Check samples project
|
2022-01-21 07:46:19 -05:00
|
|
|
env:
|
|
|
|
LOCAL_REPOSITORY_PATH: ${{ github.workspace }}/build/publications/repos
|
2022-09-14 09:40:08 -04:00
|
|
|
SAMPLES_DIR: ../spring-security-samples
|
|
|
|
VERSION: ${{ needs.prerequisites.outputs.project_version }}
|
2022-02-14 07:03:41 -05:00
|
|
|
run: |
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
|
|
|
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
2022-01-21 07:46:19 -05:00
|
|
|
./gradlew publishMavenJavaPublicationToLocalRepository
|
2022-09-14 09:40:08 -04:00
|
|
|
./gradlew cloneSamples -PcloneOutputDirectory="$SAMPLES_DIR"
|
|
|
|
./gradlew --project-dir "$SAMPLES_DIR" --init-script spring-security-ci.gradle -PlocalRepositoryPath="$LOCAL_REPOSITORY_PATH" -PspringSecurityVersion="$VERSION" :runAllTests
|
2021-09-27 17:01:46 -04:00
|
|
|
check_tangles:
|
|
|
|
name: Check for Package Tangles
|
|
|
|
needs: [ prerequisites ]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: needs.prerequisites.outputs.runjobs
|
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-27 12:07:42 -04:00
|
|
|
- name: Set up gradle
|
|
|
|
uses: spring-io/spring-gradle-build-action@v1
|
2021-09-27 17:01:46 -04:00
|
|
|
with:
|
2021-10-07 14:20:10 -04:00
|
|
|
java-version: '17'
|
2022-07-27 12:07:42 -04:00
|
|
|
distribution: 'temurin'
|
2021-09-27 17:01:46 -04:00
|
|
|
- name: Check for package tangles
|
|
|
|
run: |
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
|
|
|
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
2021-10-26 17:10:28 -04:00
|
|
|
./gradlew check s101 -Ps101.licenseId="$STRUCTURE101_LICENSEID" --stacktrace
|
2020-11-10 10:25:16 -05:00
|
|
|
deploy_artifacts:
|
|
|
|
name: Deploy Artifacts
|
2022-02-14 07:03:41 -05:00
|
|
|
needs: [build_jdk_17, snapshot_tests, check_samples, check_tangles]
|
2020-11-10 10:25:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-27 12:07:42 -04:00
|
|
|
- name: Set up gradle
|
|
|
|
uses: spring-io/spring-gradle-build-action@v1
|
2020-11-10 10:25:16 -05:00
|
|
|
with:
|
2021-10-07 14:20:10 -04:00
|
|
|
java-version: '17'
|
2022-07-27 12:07:42 -04:00
|
|
|
distribution: 'temurin'
|
2020-11-10 10:25:16 -05:00
|
|
|
- name: Deploy artifacts
|
|
|
|
run: |
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
|
|
|
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
2021-05-18 00:40:43 -04:00
|
|
|
./gradlew publishArtifacts finalizeDeployArtifacts -PossrhUsername="$OSSRH_TOKEN_USERNAME" -PossrhPassword="$OSSRH_TOKEN_PASSWORD" -PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD" --stacktrace
|
2020-11-10 10:25:16 -05:00
|
|
|
env:
|
2021-05-18 17:43:35 -04:00
|
|
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
|
|
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
|
2021-05-18 00:40:43 -04:00
|
|
|
OSSRH_TOKEN_USERNAME: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
|
|
|
|
OSSRH_TOKEN_PASSWORD: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
|
2020-11-10 10:25:16 -05:00
|
|
|
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
|
|
|
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
|
|
|
deploy_docs:
|
|
|
|
name: Deploy Docs
|
2022-02-14 07:03:41 -05:00
|
|
|
needs: [build_jdk_17, snapshot_tests, check_samples, check_tangles]
|
2020-11-10 10:25:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-27 12:07:42 -04:00
|
|
|
- name: Set up gradle
|
|
|
|
uses: spring-io/spring-gradle-build-action@v1
|
2020-11-10 10:25:16 -05:00
|
|
|
with:
|
2021-10-07 14:20:10 -04:00
|
|
|
java-version: '17'
|
2022-07-27 12:07:42 -04:00
|
|
|
distribution: 'temurin'
|
2020-11-10 10:25:16 -05:00
|
|
|
- name: Deploy Docs
|
|
|
|
run: |
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
|
|
|
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
|
|
|
./gradlew deployDocs -PdeployDocsSshKey="$DOCS_SSH_KEY" -PdeployDocsSshUsername="$DOCS_USERNAME" -PdeployDocsHost="$DOCS_HOST" --stacktrace
|
|
|
|
env:
|
|
|
|
DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
|
|
|
|
DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
|
|
|
|
DOCS_HOST: ${{ secrets.DOCS_HOST }}
|
|
|
|
deploy_schema:
|
|
|
|
name: Deploy Schema
|
2022-02-14 07:03:41 -05:00
|
|
|
needs: [build_jdk_17, snapshot_tests, check_samples, check_tangles]
|
2020-11-10 10:25:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-27 12:07:42 -04:00
|
|
|
- name: Set up gradle
|
|
|
|
uses: spring-io/spring-gradle-build-action@v1
|
2020-11-10 10:25:16 -05:00
|
|
|
with:
|
2021-10-07 14:20:10 -04:00
|
|
|
java-version: '17'
|
2022-07-27 12:07:42 -04:00
|
|
|
distribution: 'temurin'
|
2020-11-10 10:25:16 -05:00
|
|
|
- name: Deploy Schema
|
|
|
|
run: |
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
|
|
|
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
|
|
|
./gradlew deploySchema -PdeployDocsSshKey="$DOCS_SSH_KEY" -PdeployDocsSshUsername="$DOCS_USERNAME" -PdeployDocsHost="$DOCS_HOST" --stacktrace --info
|
|
|
|
env:
|
|
|
|
DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
|
|
|
|
DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
|
|
|
|
DOCS_HOST: ${{ secrets.DOCS_HOST }}
|
Add workflow step for scheduling the next milestone
This step introduces the concept of a release train to determine the appropriate release dates and schedules milestones as needed. It uses the following rules:
- If the current SNAPSHOT version is a minor release (patchVersion == 0), checks to see if a GA release exists. If not, a release train is scheduled as follows:
- Finds the next available release train starting month (including this month), either January or July.
- Schedules a release train with M1, M2, M3, RC1 and GA versions on either January/February/March/April/May or July/August/September/October/November
- If the current SNAPSHOT version is a patch release (patchVersion != 0), checks to see if a GA release exists. If not, an individual milestone is scheduled on the next even month whose release day is in the future (can include this month).
- In either case, the release day used to schedule the release is based on the configured weekOfMonth (1-4) and dayOfWeek (1-5), e.g. 3rd Monday of the month (3, 1).
If a milestone already exists, nothing is created. Once created, milestone due dates can be updated manually as desired.
Closes gh-10458
2022-05-05 15:28:49 -04:00
|
|
|
perform_release:
|
|
|
|
name: Perform release
|
2022-03-02 17:16:59 -05:00
|
|
|
needs: [prerequisites, deploy_artifacts, deploy_docs, deploy_schema]
|
|
|
|
runs-on: ubuntu-latest
|
2022-07-26 16:31:10 -04:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2022-03-02 17:16:59 -05:00
|
|
|
timeout-minutes: 90
|
|
|
|
if: ${{ !endsWith(needs.prerequisites.outputs.project_version, '-SNAPSHOT') }}
|
|
|
|
env:
|
|
|
|
REPO: ${{ github.repository }}
|
|
|
|
BRANCH: ${{ github.ref_name }}
|
|
|
|
TOKEN: ${{ github.token }}
|
|
|
|
VERSION: ${{ needs.prerequisites.outputs.project_version }}
|
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
Add workflow step for scheduling the next milestone
This step introduces the concept of a release train to determine the appropriate release dates and schedules milestones as needed. It uses the following rules:
- If the current SNAPSHOT version is a minor release (patchVersion == 0), checks to see if a GA release exists. If not, a release train is scheduled as follows:
- Finds the next available release train starting month (including this month), either January or July.
- Schedules a release train with M1, M2, M3, RC1 and GA versions on either January/February/March/April/May or July/August/September/October/November
- If the current SNAPSHOT version is a patch release (patchVersion != 0), checks to see if a GA release exists. If not, an individual milestone is scheduled on the next even month whose release day is in the future (can include this month).
- In either case, the release day used to schedule the release is based on the configured weekOfMonth (1-4) and dayOfWeek (1-5), e.g. 3rd Monday of the month (3, 1).
If a milestone already exists, nothing is created. Once created, milestone due dates can be updated manually as desired.
Closes gh-10458
2022-05-05 15:28:49 -04:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
|
2022-07-27 12:07:42 -04:00
|
|
|
- name: Set up gradle
|
|
|
|
uses: spring-io/spring-gradle-build-action@v1
|
2022-03-02 17:16:59 -05:00
|
|
|
with:
|
|
|
|
java-version: '17'
|
2022-07-27 12:07:42 -04:00
|
|
|
distribution: 'temurin'
|
2022-03-02 17:16:59 -05:00
|
|
|
- name: Wait for Artifactory Artifacts
|
|
|
|
if: ${{ contains(needs.prerequisites.outputs.project_version, '-RC') || contains(needs.prerequisites.outputs.project_version, '-M') }}
|
|
|
|
run: |
|
|
|
|
echo "Wait for artifacts of $REPO@$VERSION to appear on Artifactory."
|
|
|
|
until curl -f -s https://repo.spring.io/artifactory/milestone/org/springframework/security/spring-security-core/$VERSION/ > /dev/null
|
|
|
|
do
|
|
|
|
sleep 30
|
|
|
|
echo "."
|
|
|
|
done
|
|
|
|
echo "Artifacts for $REPO@$VERSION have been released to Artifactory."
|
|
|
|
- name: Wait for Maven Central Artifacts
|
|
|
|
if: ${{ !contains(needs.prerequisites.outputs.project_version, '-RC') && !contains(needs.prerequisites.outputs.project_version, '-M') }}
|
|
|
|
run: |
|
|
|
|
echo "Wait for artifacts of $REPO@$VERSION to appear on Maven Central."
|
|
|
|
until curl -f -s https://repo1.maven.org/maven2/org/springframework/security/spring-security-core/$VERSION/ > /dev/null
|
|
|
|
do
|
|
|
|
sleep 30
|
|
|
|
echo "."
|
|
|
|
done
|
|
|
|
echo "Artifacts for $REPO@$VERSION have been released to Maven Central."
|
|
|
|
- name: Create GitHub Release
|
|
|
|
run: |
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
|
|
|
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
|
|
|
echo "Tagging and publishing $REPO@$VERSION release on GitHub."
|
|
|
|
./gradlew createGitHubRelease -PnextVersion=$VERSION -Pbranch=$BRANCH -PcreateRelease=true -PgitHubAccessToken=$TOKEN
|
2022-06-10 18:17:01 -04:00
|
|
|
- name: Announce Release on Slack
|
|
|
|
id: spring-security-announcing
|
|
|
|
uses: slackapi/slack-github-action@v1.19.0
|
|
|
|
with:
|
|
|
|
payload: |
|
|
|
|
{
|
|
|
|
"text": "spring-security-announcing `${{ env.VERSION }}` is available now",
|
|
|
|
"blocks": [
|
|
|
|
{
|
|
|
|
"type": "section",
|
|
|
|
"text": {
|
|
|
|
"type": "mrkdwn",
|
|
|
|
"text": "spring-security-announcing `${{ env.VERSION }}` is available now"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }}
|
|
|
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
2022-03-18 12:04:17 -04:00
|
|
|
- name: Setup git config
|
|
|
|
run: |
|
|
|
|
git config user.name 'github-actions[bot]'
|
|
|
|
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
|
|
|
- name: Update to next Snapshot Version
|
|
|
|
run: |
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
|
|
|
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
|
|
|
|
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
|
|
|
|
echo "Updating $REPO@$VERSION to next snapshot version."
|
2022-03-29 06:25:55 -04:00
|
|
|
./gradlew :updateToSnapshotVersion
|
|
|
|
git commit -am "Next development version"
|
2022-03-18 12:04:17 -04:00
|
|
|
git push
|
Add workflow step for scheduling the next milestone
This step introduces the concept of a release train to determine the appropriate release dates and schedules milestones as needed. It uses the following rules:
- If the current SNAPSHOT version is a minor release (patchVersion == 0), checks to see if a GA release exists. If not, a release train is scheduled as follows:
- Finds the next available release train starting month (including this month), either January or July.
- Schedules a release train with M1, M2, M3, RC1 and GA versions on either January/February/March/April/May or July/August/September/October/November
- If the current SNAPSHOT version is a patch release (patchVersion != 0), checks to see if a GA release exists. If not, an individual milestone is scheduled on the next even month whose release day is in the future (can include this month).
- In either case, the release day used to schedule the release is based on the configured weekOfMonth (1-4) and dayOfWeek (1-5), e.g. 3rd Monday of the month (3, 1).
If a milestone already exists, nothing is created. Once created, milestone due dates can be updated manually as desired.
Closes gh-10458
2022-05-05 15:28:49 -04:00
|
|
|
perform_post_release:
|
|
|
|
name: Perform post-release
|
|
|
|
needs: [prerequisites, deploy_artifacts, deploy_docs, deploy_schema]
|
|
|
|
runs-on: ubuntu-latest
|
2022-07-26 16:31:10 -04:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
issues: write
|
Add workflow step for scheduling the next milestone
This step introduces the concept of a release train to determine the appropriate release dates and schedules milestones as needed. It uses the following rules:
- If the current SNAPSHOT version is a minor release (patchVersion == 0), checks to see if a GA release exists. If not, a release train is scheduled as follows:
- Finds the next available release train starting month (including this month), either January or July.
- Schedules a release train with M1, M2, M3, RC1 and GA versions on either January/February/March/April/May or July/August/September/October/November
- If the current SNAPSHOT version is a patch release (patchVersion != 0), checks to see if a GA release exists. If not, an individual milestone is scheduled on the next even month whose release day is in the future (can include this month).
- In either case, the release day used to schedule the release is based on the configured weekOfMonth (1-4) and dayOfWeek (1-5), e.g. 3rd Monday of the month (3, 1).
If a milestone already exists, nothing is created. Once created, milestone due dates can be updated manually as desired.
Closes gh-10458
2022-05-05 15:28:49 -04:00
|
|
|
timeout-minutes: 90
|
|
|
|
if: ${{ endsWith(needs.prerequisites.outputs.project_version, '-SNAPSHOT') }}
|
|
|
|
env:
|
|
|
|
TOKEN: ${{ github.token }}
|
|
|
|
VERSION: ${{ needs.prerequisites.outputs.project_version }}
|
|
|
|
steps:
|
2022-11-24 22:37:39 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-27 12:07:42 -04:00
|
|
|
- name: Set up gradle
|
|
|
|
uses: spring-io/spring-gradle-build-action@v1
|
|
|
|
with:
|
|
|
|
java-version: '17'
|
|
|
|
distribution: 'temurin'
|
Add workflow step for scheduling the next milestone
This step introduces the concept of a release train to determine the appropriate release dates and schedules milestones as needed. It uses the following rules:
- If the current SNAPSHOT version is a minor release (patchVersion == 0), checks to see if a GA release exists. If not, a release train is scheduled as follows:
- Finds the next available release train starting month (including this month), either January or July.
- Schedules a release train with M1, M2, M3, RC1 and GA versions on either January/February/March/April/May or July/August/September/October/November
- If the current SNAPSHOT version is a patch release (patchVersion != 0), checks to see if a GA release exists. If not, an individual milestone is scheduled on the next even month whose release day is in the future (can include this month).
- In either case, the release day used to schedule the release is based on the configured weekOfMonth (1-4) and dayOfWeek (1-5), e.g. 3rd Monday of the month (3, 1).
If a milestone already exists, nothing is created. Once created, milestone due dates can be updated manually as desired.
Closes gh-10458
2022-05-05 15:28:49 -04:00
|
|
|
- name: Schedule next release (if not already scheduled)
|
|
|
|
run: ./gradlew scheduleNextRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
|
2020-11-10 10:25:16 -05:00
|
|
|
notify_result:
|
|
|
|
name: Check for failures
|
2022-07-27 16:32:21 -04:00
|
|
|
needs: [perform_release, perform_post_release]
|
2021-05-24 16:59:00 -04:00
|
|
|
if: failure()
|
2020-11-10 10:25:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
2022-07-26 16:31:10 -04:00
|
|
|
permissions:
|
|
|
|
actions: read
|
2020-11-10 10:25:16 -05:00
|
|
|
steps:
|
|
|
|
- name: Send Slack message
|
2022-06-07 17:03:31 -04:00
|
|
|
# Workaround while waiting for Gamesight/slack-workflow-status#38 to be fixed
|
|
|
|
# See https://github.com/Gamesight/slack-workflow-status/issues/38
|
2022-07-05 18:49:46 -04:00
|
|
|
uses: sjohnr/slack-workflow-status@v1-beta
|
2020-11-10 10:25:16 -05:00
|
|
|
with:
|
2021-05-24 16:59:00 -04:00
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
channel: '#spring-security-ci'
|
|
|
|
name: 'CI Notifier'
|