diff --git a/.github/actions/tag-and-release/action.yml b/.github/actions/tag-and-release/action.yml index 9e60b1504f..c74f19517b 100644 --- a/.github/actions/tag-and-release/action.yml +++ b/.github/actions/tag-and-release/action.yml @@ -1,10 +1,9 @@ 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 @@ -12,5 +11,5 @@ runs: using: 'docker' image: 'Dockerfile' args: - - ${{ inputs.token }} + - ${{ inputs.target_branch }} - ${{ inputs.grails_version }} diff --git a/.github/actions/tag-and-release/entrypoint.sh b/.github/actions/tag-and-release/entrypoint.sh index c32aceb886..0a7e29da99 100755 --- a/.github/actions/tag-and-release/entrypoint.sh +++ b/.github/actions/tag-and-release/entrypoint.sh @@ -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" @@ -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 @@ -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 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ba83b803eb..78ea7fd6db 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,4 +1,4 @@ -name: Java CI +name: "Java CI" on: push: branches: @@ -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') || diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2048650bb6..e52f963353 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: "Release" on: workflow_dispatch: inputs: @@ -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 }} diff --git a/settings.gradle b/settings.gradle index 4bd1798e1b..70dd56f87f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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') - } - }} \ No newline at end of file + } +} diff --git a/src/en/guide/upgrading/upgrading60x.adoc b/src/en/guide/upgrading/upgrading60x.adoc index 1628e2069f..dfd47456df 100644 --- a/src/en/guide/upgrading/upgrading60x.adoc +++ b/src/en/guide/upgrading/upgrading60x.adoc @@ -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 \ No newline at end of file +- 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' + } +} +---- \ No newline at end of file