Skip to content

Commit

Permalink
Merge pull request #951 from grails/matrei/ehcache-breaking
Browse files Browse the repository at this point in the history
Document breaking `hibernate-ehcache` change
  • Loading branch information
matrei authored Feb 7, 2025
2 parents 3976241 + 4094ee3 commit 4dfefc4
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 109 deletions.
7 changes: 3 additions & 4 deletions .github/actions/tag-and-release/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: 'Grails Docs Release Action'
description: 'Update grailsVersion and add release tag'
inputs:
token:
description: 'GitHub token to authenticate the requests'
target_branch:
description: 'Target Branch'
required: true
default: ${{ github.token }}
grails_version:
description: 'Grails Release Version'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.token }}
- ${{ inputs.target_branch }}
- ${{ inputs.grails_version }}
11 changes: 6 additions & 5 deletions .github/actions/tag-and-release/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
# $1 == GH_TOKEN
# $1 == Target Branch
# $2 == Grails Version

target_branch="$1"
grails_version="$2"
echo -n "Updating Grails version to: $grails_version"

Expand All @@ -18,8 +19,8 @@ git config --global user.email "$GIT_USER_EMAIL"
git config --global user.name "$GIT_USER_NAME"
git config --global --add safe.directory /github/workspace

git checkout $TARGET_BRANCH
git pull origin $TARGET_BRANCH
git checkout $target_branch
git pull origin $target_branch

echo "Setting release version in gradle.properties"
sed -i "s/^grails\.version.*$/grails\.version\=${grails_version}/" gradle.properties
Expand All @@ -28,7 +29,7 @@ cat gradle.properties
echo "Pushing release version and recreating v${grails_version} tag"
git add gradle.properties
git commit -m "[skip ci] Release v${grails_version} docs"
git push origin $TARGET_BRANCH
git push origin $target_branch
git push origin :refs/tags/v${grails_version}
git tag -fa v${grails_version} -m "[skip ci] Release v${grails_version} docs"
git push origin $TARGET_BRANCH --tags
git push origin $target_branch --tags
48 changes: 23 additions & 25 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI
name: "Java CI"
on:
push:
branches:
Expand All @@ -8,49 +8,47 @@ on:
- '[4-9]+.[0-9]+.x'
workflow_dispatch:
env:
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: 'grails-build@users.noreply.github.com'
GIT_USER_NAME: grails-build
GIT_USER_EMAIL: grails-build@users.noreply.github.com
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- name: Set current date as env variable
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
- name: "📅 Set current date as env variable"
run: echo "NOW=$(date +'%Y-%m-%dT%H%M%S')" >> $GITHUB_ENV
- uses: actions/setup-java@v4
with: { java-version: 17, distribution: liberica }
- name: Extract branch name
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
java-version: 17
distribution: liberica
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "🔀 Extract branch name"
id: extract_branch
run: echo "value=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Build Snapshot Documentation
uses: gradle/actions/setup-gradle@v3
- name: "🔨 Build Snapshot Documentation"
env:
TARGET_GRAILS_VERSION: ${{ github.event.inputs.grails_version }}
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }}
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: |
build
-PgithubBranch=${{ steps.extract_branch.outputs.value }}
- name: Upload Docs Artifacts
run: ./gradlew build -PgithubBranch=${{ steps.extract_branch.outputs.value }}
- name: "📤 Upload Docs Artifacts"
if: success()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: grails-docs-${{ env.NOW }}.zip
path: ./build/distributions/*.zip
- name: Publish Snapshot Documentation to Github Pages
- name: "📤 Publish Snapshot Documentation to Github Pages"
if: success() && github.event_name == 'push'
uses: grails/github-pages-deploy-action@v2
uses: grails/github-pages-deploy-action@f1bddf4d126e4375529c0f397b028eb5ac9a13e6 # 2024-12-22
env:
BRANCH: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
FOLDER: build/docs
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TARGET_REPOSITORY: ${{ github.repository }}
SKIP_SNAPSHOT: ${{
startsWith(steps.extract_branch.outputs.value, '3.3') ||
startsWith(steps.extract_branch.outputs.value, '4.1') ||
Expand Down
93 changes: 39 additions & 54 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: "Release"
on:
workflow_dispatch:
inputs:
Expand All @@ -7,89 +7,74 @@ on:
required: true
jobs:
release:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
env:
BETA: ${{ contains(github.event.inputs.grails_version, 'M') }}
BETA: ${{
contains(github.event.inputs.grails_version, 'M') ||
contains(github.event.inputs.grails_version, 'RC')
}}
SKIP_SNAPSHOT: ${{
startsWith(github.event.inputs.grails_version, '3.3') ||
startsWith(github.event.inputs.grails_version, '4.1') ||
startsWith(github.event.inputs.grails_version, '5.3') ||
startsWith(github.event.inputs.grails_version' '6.2') ||
contains(github.event.inputs.grails_version, 'M') ||
contains(github.event.inputs.grails_version, 'RC')
}}
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: 'grails-build@users.noreply.github.com'
GIT_USER_NAME: grails-build
GIT_USER_EMAIL: grails-build@users.noreply.github.com
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with: { java-version: 17, distribution: liberica }
- name: Extract branch name
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
java-version: 17
distribution: liberica
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "🔀 Extract branch name"
if: success() && github.event_name == 'workflow_dispatch'
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Asset Path
if: success() && github.event_name == 'workflow_dispatch'
id: asset_path
uses: haya14busa/action-cond@v1
env:
PATH_PREFIX: "./build/distributions/grails-docs"
with:
cond: ${{ env.BETA == '' || env.BETA == 'false' }}
if_true: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.grails_version }}.zip
if_false: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.grails_version }}.zip
- name: Tag and Release Docs
- name: "🏷️ Create and Push Release Tag"
uses: ./.github/actions/tag-and-release
if: success() && github.event_name == 'workflow_dispatch'
env:
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
target_branch: ${{ steps.extract_branch.outputs.value }}
grails_version: ${{ github.event.inputs.grails_version }}
- name: Create Release
- name: "🎉 Create GitHub Release"
if: success() && github.event_name == 'workflow_dispatch'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0 (Use commit sha as this is a 3rd party action)
with:
tag_name: v${{ github.event.inputs.grails_version }}
release_name: v${{ github.event.inputs.grails_version }}
draft: false
tag: v${{ github.event.inputs.grails_version }}
name: ${{ github.event.inputs.grails_version }}
prerelease: ${{ env.BETA }}
- name: Publish Documentation
uses: gradle/actions/setup-gradle@v3
- name: "🔨 Generate Documentation"
env:
TARGET_GRAILS_VERSION: ${{ github.event.inputs.grails_version }}
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }}
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: |
assemble
-PgithubBranch=${{ steps.extract_branch.outputs.value }}
--info
--stacktrace
- name: Upload Release Asset
run: >
./gradlew assemble
-PgithubBranch=${{ steps.extract_branch.outputs.value }}
--info --stacktrace
- name: "📤 Upload Asset to the Github Release page"
if: success() && github.event_name == 'workflow_dispatch'
id: upload-release-asset
uses: actions/upload-release-asset@v1
id: upload_artifact
uses: Roang-zero1/github-upload-release-artifacts-action@c15e0b65ce2ae1c8d52bfbc75d017d21e1da77d7 # v3.0.0 (Use commit sha as this is a 3rd party action)
with:
args: ./build/distributions/grails-docs-${{ github.event.inputs.grails_version }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.asset_path.outputs.value }}
asset_name: grails-docs.zip
asset_content_type: application/zip
- name: Publish to Github Pages
- name: "📤 Publish to Github Pages"
if: success()
uses: grails/github-pages-deploy-action@v2
uses: grails/github-pages-deploy-action@f1bddf4d126e4375529c0f397b028eb5ac9a13e6 # 2024-12-22
env:
BRANCH: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
FOLDER: build/docs
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TARGET_REPOSITORY: ${{ github.repository }}
VERSION: ${{ github.event.inputs.grails_version }}
36 changes: 16 additions & 20 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
plugins {
id "com.gradle.enterprise" version '3.16.2'
id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.13'
id 'com.gradle.develocity' version '3.19.1'
id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.1'
}

gradleEnterprise {
def isCI = System.getenv('CI') != null
def isLocal = !isCI
def isAuthenticated = System.getenv('DEVELOCITY_ACCESS_KEY') != null

develocity {
server = 'https://ge.grails.org'
buildScan {
publishAlwaysIf(System.getenv('CI') == 'true')
publishIfAuthenticated()
uploadInBackground = System.getenv("CI") == null
capture {
taskInputFiles = true
}
tag('grails')
tag('grails-doc')
publishing.onlyIf { isAuthenticated }
uploadInBackground = isLocal
}

}

buildCache {
local { enabled = System.getenv('CI') != 'true' }
remote(HttpBuildCache) {
def isAuthenticated = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER') && System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY')
push = System.getenv('CI') == 'true' && isAuthenticated
local { enabled = isLocal }
remote(develocity.buildCache) {
push = isCI && isAuthenticated
enabled = true
url = 'https://ge.grails.org/cache/'
credentials {
username = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER')
password = System.getenv('GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY')
}
}}
}
}
20 changes: 19 additions & 1 deletion src/en/guide/upgrading/upgrading60x.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,22 @@ Grails 7 introduces several breaking changes that may require updates to your ap
- The following dependencies are no longer included in Grails or grails-bom: io.micronaut:micronaut-\*, io.micronaut.cache:micronaut-cache-core, io.micronaut.groovy:micronaut-runtime-groovy and io.micronaut.spring:micronaut-spring-*
- Micronaut can be added via the Micronaut Spring Boot Starter: https://micronaut-projects.github.io/micronaut-spring/latest/guide/#springBootStarter.
- Using Micronaut Parent Context: https://micronaut-projects.github.io/micronaut-spring/latest/guide/#springParentContext
- Using a Bean Post Processor: https://micronaut-projects.github.io/micronaut-spring/latest/guide/#beanPostProcessor
- Using a Bean Post Processor: https://micronaut-projects.github.io/micronaut-spring/latest/guide/#beanPostProcessor

#### 8.3 hibernate-ehcache

The `org.hibernate:hibernate-ehcache` library is no longer provided by the `org.grails.plugins:hibernate5` plugin. If
your application depends on `hibernate-ehcache`, you must now add it explicitly to your project dependencies.

Since `hibernate-ehcache` brings in a conflicting `javax` version of `org.hibernate:hibernate-core`, it is
recommended to exclude `hibernate-core` from the `hibernate-ehcache` dependency to avoid conflicts:

[source,groovy]
.build.gradle
----
dependencies {
implementation 'org.hibernate:hibernate-ehcache:5.6.15.Final', {
exclude group: 'org.hibernate', module: 'hibernate-core'
}
}
----

0 comments on commit 4dfefc4

Please sign in to comment.