mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-09 06:50:05 +00:00
Add gradle-build-action to GitHub Actions pipelines
Closes gh-11099
This commit is contained in:
parent
5367524030
commit
9601efd341
4
.github/workflows/antora-generate.yml
vendored
4
.github/workflows/antora-generate.yml
vendored
@ -16,6 +16,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Source
|
- name: Checkout Source
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Generate antora.yml
|
- name: Generate antora.yml
|
||||||
run: ./gradlew :spring-security-docs:generateAntora
|
run: ./gradlew :spring-security-docs:generateAntora
|
||||||
- name: Extract Branch Name
|
- name: Extract Branch Name
|
||||||
|
@ -56,11 +56,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
- name: Cache Gradle packages
|
- name: Setup Gradle
|
||||||
uses: actions/cache@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
env:
|
||||||
path: ~/.gradle/caches
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
env:
|
env:
|
||||||
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
|
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
|
||||||
@ -82,6 +81,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Snapshot Tests
|
- name: Snapshot Tests
|
||||||
run: |
|
run: |
|
||||||
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
||||||
@ -103,6 +106,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Check samples project
|
- name: Check samples project
|
||||||
run: |
|
run: |
|
||||||
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
||||||
@ -124,6 +131,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Check for package tangles
|
- name: Check for package tangles
|
||||||
run: |
|
run: |
|
||||||
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
||||||
@ -144,6 +155,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Deploy artifacts
|
- name: Deploy artifacts
|
||||||
run: |
|
run: |
|
||||||
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
||||||
@ -171,6 +186,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Deploy Docs
|
- name: Deploy Docs
|
||||||
run: |
|
run: |
|
||||||
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
||||||
@ -195,6 +214,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Deploy Schema
|
- name: Deploy Schema
|
||||||
run: |
|
run: |
|
||||||
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
||||||
@ -226,6 +249,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Wait for Artifactory Artifacts
|
- name: Wait for Artifactory Artifacts
|
||||||
if: ${{ contains(needs.prerequisites.outputs.project_version, '-RC') || contains(needs.prerequisites.outputs.project_version, '-M') }}
|
if: ${{ contains(needs.prerequisites.outputs.project_version, '-RC') || contains(needs.prerequisites.outputs.project_version, '-M') }}
|
||||||
run: |
|
run: |
|
||||||
|
17
.github/workflows/deploy-reference.yml
vendored
17
.github/workflows/deploy-reference.yml
vendored
@ -18,16 +18,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
cache: gradle
|
|
||||||
- name: Validate Gradle wrapper
|
- name: Validate Gradle wrapper
|
||||||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
|
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
|
||||||
- name: Build with Gradle
|
- name: Setup Gradle
|
||||||
run: ./gradlew :spring-security-docs:antora --stacktrace
|
uses: gradle/gradle-build-action@v2
|
||||||
- name: Cleanup Gradle Cache
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
|
with:
|
||||||
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
|
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
|
||||||
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
|
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
|
||||||
run: |
|
gradle-home-cache-excludes: |
|
||||||
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
caches/modules-2/modules-2.lock
|
||||||
rm -f ~/.gradle/caches/modules-2/gc.properties
|
caches/modules-2/gc.properties
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew :spring-security-docs:antora --stacktrace
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: ${GITHUB_WORKSPACE}/.github/actions/algolia-deploy.sh "${{ secrets.DOCS_USERNAME }}@${{ secrets.DOCS_HOST }}" "/opt/www/domains/spring.io/docs/htdocs/spring-security/reference/" "${{ secrets.DOCS_SSH_KEY }}" "${{ secrets.DOCS_SSH_HOST_KEY }}"
|
run: ${GITHUB_WORKSPACE}/.github/actions/algolia-deploy.sh "${{ secrets.DOCS_USERNAME }}@${{ secrets.DOCS_HOST }}" "/opt/www/domains/spring.io/docs/htdocs/spring-security/reference/" "${{ secrets.DOCS_SSH_KEY }}" "${{ secrets.DOCS_SSH_HOST_KEY }}"
|
||||||
|
9
.github/workflows/pr-build-workflow.yml
vendored
9
.github/workflows/pr-build-workflow.yml
vendored
@ -17,12 +17,13 @@ jobs:
|
|||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
- name: Cache Gradle packages
|
- name: Setup Gradle
|
||||||
if: env.RUN_JOBS == 'true'
|
if: env.RUN_JOBS == 'true'
|
||||||
uses: actions/cache@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle/caches
|
cache-read-only: true
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
if: env.RUN_JOBS == 'true'
|
if: env.RUN_JOBS == 'true'
|
||||||
run: ./gradlew clean build --continue --scan
|
run: ./gradlew clean build --continue --scan
|
||||||
|
17
.github/workflows/release-next-version.yml
vendored
17
.github/workflows/release-next-version.yml
vendored
@ -38,11 +38,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
- name: Cache Gradle packages
|
- name: Setup Gradle
|
||||||
uses: actions/cache@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
env:
|
||||||
path: ~/.gradle/caches
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
||||||
- name: Check release
|
- name: Check release
|
||||||
run: |
|
run: |
|
||||||
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
||||||
@ -63,6 +62,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Check for open issues
|
- name: Check for open issues
|
||||||
run: |
|
run: |
|
||||||
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
|
||||||
@ -83,6 +86,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
env:
|
||||||
|
GRADLE_USER_HOME: ~/.gradle
|
||||||
- name: Setup git config
|
- name: Setup git config
|
||||||
run: |
|
run: |
|
||||||
git config user.name 'github-actions[bot]'
|
git config user.name 'github-actions[bot]'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user