Skip to content

Commit

Permalink
fix(build): Update Build and CI (#1005)
Browse files Browse the repository at this point in the history
- Use version catalogs
- Cleanup and update Github workflows
- Cleanup test apps
- Cleanup unused dependencies
- Update dependencies
- Set correct/minimal dependency configuration scopes
- Remove unused imports
- Move docs dropdown version list to gradle.properties
  • Loading branch information
matrei authored Mar 28, 2024
1 parent 47b2991 commit 8786567
Show file tree
Hide file tree
Showing 88 changed files with 996 additions and 12,176 deletions.
96 changes: 90 additions & 6 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,109 @@
name-template: $RESOLVED_VERSION
tag-template: v$RESOLVED_VERSION
pull-request:
title-templates:
fix: '🐛 $TITLE (#$NUMBER)'
feat: '🚀 $TITLE (#$NUMBER)'
default: '$TITLE (#$NUMBER)'
autolabeler:
- label: 'bug'
branch:
- '/fix\/.+/'
title:
- '/fix/i'
- label: 'feature'
branch:
- '/feature\/.+/'
title:
- '/feat/i'
- label: 'documentation'
branch:
- '/docs\/.+/'
title:
- '/docs/i'
- label: 'maintenance'
branch:
- '/(chore|refactor|style|test|ci|perf|build|deps)\/.+/'
title:
- '/(chore|refactor|style|test|ci|perf|build|deps)/i'
- label: 'chore'
branch:
- '/chore\/.+/'
title:
- '/chore/i'
- label: 'refactor'
branch:
- '/refactor\/.+/'
title:
- '/refactor/i'
- label: 'style'
branch:
- '/style\/.+/'
title:
- '/style/i'
- label: 'test'
branch:
- '/test\/.+/'
title:
- '/test/i'
- label: 'ci'
branch:
- '/ci\/.+/'
title:
- '/ci/i'
- label: 'perf'
branch:
- '/perf\/.+/'
title:
- '/perf/i'
- label: 'build'
branch:
- '/build\/.+/'
title:
- '/build/i'
- label: 'deps'
branch:
- '/deps\/.+/'
title:
- '/deps/i'
- label: 'revert'
branch:
- '/revert\/.+/'
title:
- '/revert/i'
categories:
- title: 🚀 Features
- title: '🚀 Features'
labels:
- 'feat'
- "type: enhancement"
- "type: new feature"
- "type: major"
- title: 🚀 Bug Fixes/Improvements
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- "type: improvement"
- "type: bug"
- "type: minor"
- title: 🛠 Dependency upgrades
- title: '📚 Documentation'
labels:
- 'docs'
- title: '🔧 Maintenance'
labels:
- 'chore'
- 'refactor'
- 'style'
- 'test'
- 'ci'
- 'perf'
- 'build'
- 'deps'
- "type: dependency upgrade"
- "dependencies"
- title: ⚙️ Build/CI
labels:
- "type: ci"
- "type: build"
- title: '⏪ Reverts'
labels:
- 'revert'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver:
major:
Expand All @@ -31,7 +116,6 @@ version-resolver:
labels:
- 'type: patch'
default: patch
filter-by-commitish: false
template: |
## What's Changed
Expand Down
125 changes: 41 additions & 84 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,135 +9,92 @@ on:
- '[4-9]+.[0-9]+.x'
- '[3-9]+.[3-9]+.x'
workflow_dispatch:
env:
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: [email protected]

jobs:
core-tests:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
env:
WORKSPACE: ${{ github.workspace }}
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11.0.6'
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with: { java-version: 11, distribution: temurin }
- name: Run Tests
if: github.event_name == 'pull_request'
id: tests
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: |
check
-Dgeb.env=chromeHeadless
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Publish Test Report
if: steps.tests.outcome == 'failure'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
functional-test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
matrix:
test-config: [ 'static', 'annotation', 'requestmap', 'basic', 'misc', 'putWithParams', 'bcrypt', 'issue503' ]
env:
WORKSPACE: ${{ github.workspace }}
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11.0.6'
- uses: actions/setup-java@v4
with: { java-version: 11, distribution: temurin }
- name: Run Tests
id: tests
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: |
examples-functional-test-app:check
-Dgeb.env=chromeHeadless
-DTESTCONFIG=${{ matrix.test-config }}
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Publish Test Report
if: steps.tests.outcome == 'failure'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/examples/functional-test-app/build/test-results/test/TEST-*.xml'
build:
if: github.event_name == 'push'
runs-on: ubuntu-latest
env:
WORKSPACE: ${{ github.workspace }}
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11.0.6'
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with: { java-version: 11, distribution: temurin }
- name: Run Build
if: github.event_name == 'push'
id: build
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
with:
arguments: |
:spring-security-core:build
spring-security-core:build
-Dgeb.env=chromeHeadless
- name: Publish Test Report
if: steps.build.outcome == 'failure'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Publish to repo.grails.org
id: publish
uses: gradle/gradle-build-action@v2
if: steps.build.outcome == 'success' && github.event_name == 'push'
- name: Publish Snapshot artifacts to Artifactory (repo.grails.org)
uses: gradle/actions/setup-gradle@v3
if: success()
env:
ORG_GRADLE_PROJECT_artifactoryUsername: ${{ secrets.ARTIFACTORY_USERNAME }}
ORG_GRADLE_PROJECT_artifactoryPassword: ${{ secrets.ARTIFACTORY_PASSWORD }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
with:
arguments: |
-Dorg.gradle.internal.publish.checksums.insecure=true
:spring-security-core:publish
- name: Build Docs
id: docs
if: steps.build.outcome == 'success' && github.event_name == 'push'
uses: gradle/gradle-build-action@v2
with:
arguments: :spring-security-core:docs
spring-security-core:publish
- name: Generate Snapshot Documentation
if: success()
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: Publish to Github Pages
if: steps.docs.outcome == 'success' && github.event_name == 'push'
with:
arguments: spring-security-core:docs

- name: Publish Snapshot Documentation to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@grails
env:
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
FOLDER: plugin/build/docs
DOC_FOLDER: gh-pages
COMMIT_EMAIL: [email protected]
COMMIT_NAME: Puneet Behl
GH_TOKEN: ${{ secrets.GH_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
push:
branches:
- '[4-9]+.[0-9]+.x'
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]
workflow_dispatch:
jobs:
release_notes:
Expand All @@ -20,7 +24,7 @@ jobs:
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
# If it has release drafter:
- uses: release-drafter/release-drafter@v5.25.0
- uses: release-drafter/release-drafter@v6
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
Loading

0 comments on commit 8786567

Please sign in to comment.