diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000..c082fa4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,60 @@ +name: Bug Report +description: File a bug report +body: + - type: markdown + attributes: + value: | + Thanks for reporting an issue for Grails framework, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed. + + NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/grails) or Slack (https://slack-signup.grails.org). DO NOT use the issue tracker to ask questions. + - type: textarea + attributes: + label: Expected Behavior + description: A concise description of what you expected to happen. + placeholder: Tell us what should happen + validations: + required: false + - type: textarea + attributes: + label: Actual Behaviour + description: A concise description of what you're experiencing. + placeholder: Tell us what happens instead + validations: + required: false + - type: textarea + attributes: + label: Steps To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. In this environment... + 2. With this config... + 3. Run '...' + 4. See error... + validations: + required: false + - type: textarea + attributes: + label: Environment Information + description: Environment information where the problem occurs. + placeholder: | + - Operating System: + - JDK Version: + validations: + required: false + - type: input + id: example + attributes: + label: Example Application + description: Example application link. + placeholder: | + Link to GitHub repository with an example that reproduces the issue + validations: + required: false + - type: input + id: version + attributes: + label: Version + description: Grails version + validations: + required: true + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..1a40780 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,7 @@ +contact_links: + - name: Stack Overflow + url: https://stackoverflow.com/tags/grails + about: Ask questions on Stack Overflow + - name: Grails Slack + url: https://grails.slack.com/ + about: Chat with us on Grails Community Slack. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/new_feature.yaml b/.github/ISSUE_TEMPLATE/new_feature.yaml new file mode 100644 index 0000000..6093df0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new_feature.yaml @@ -0,0 +1,14 @@ +name: Feature request +description: Create a new feature request +body: + - type: markdown + attributes: + value: | + Please describe the feature you want for Grails® framework to implement, before that check if there is already an existing issue to add it. + - type: textarea + attributes: + label: Feature description + placeholder: Tell us more about the feature you would like for Grails® framework to have and what problem is it going to solve + validations: + required: true + diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml new file mode 100644 index 0000000..8e3b7e9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -0,0 +1,9 @@ +name: Other +description: Something different +body: + - type: textarea + attributes: + label: Issue description + validations: + required: true + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..78a5184 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,45 @@ +version: 2 +updates: + - package-ecosystem: gradle + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 0 + target-branch: 3.3.x + labels: + - "type: dependency upgrade" + - "relates-to: v3" + - package-ecosystem: gradle + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 0 + target-branch: 4.1.x + labels: + - "type: dependency upgrade" + - "relates-to: v4" + ignore: + - dependency-name: "*" + update-types: [ "version-update:semver-minor", "version-update:semver-major" ] + - package-ecosystem: gradle + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + target-branch: 5.4.x + labels: + - "type: dependency upgrade" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-major"] + - package-ecosystem: gradle + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + target-branch: 6.0.x + labels: + - "type: dependency upgrade" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-patch", "version-update:semver-minor"] diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..6c4938f --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,41 @@ +name-template: $RESOLVED_VERSION +tag-template: v$RESOLVED_VERSION +categories: + - title: ✨ Features + labels: + - "type: enhancement" + - "type: new feature" + - "type: major" + - title: 🐛 Bug Fixes/Improvements + labels: + - "type: improvement" + - "type: bug" + - "type: minor" + - title: 🛠 Dependency upgrades + labels: + - "type: dependency upgrade" + - "dependencies" + - title: ⚙️ Build/CI + labels: + - "type: ci" + - "type: build" +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +version-resolver: + major: + labels: + - 'type: major' + minor: + labels: + - 'type: minor' + patch: + labels: + - 'type: patch' + default: patch +template: | + ## What's Changed + + $CHANGES + + ## Contributors + + $CONTRIBUTORS diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..f50d856 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,70 @@ +{ + "extends": [ + "config:base", + "helpers:pinGitHubActionDigests" + ], + "labels": ["type: dependency upgrade"], + "packageRules": [ + { + "matchUpdateTypes": ["pin", "digest"], + "enabled": false + }, + { + "matchPackagePatterns": ["*"], + "allowedVersions": "!/SNAPSHOT$/" + }, + { + "matchPackagePatterns": [ + "^org\\.codehaus\\.groovy" + ], + "groupName": "groovy monorepo" + }, + { + "matchPackagePatterns": [ + "^org\\.apache\\.ant" + ], + "groupName": "apache-ant monorepo" + }, + { + "matchPackagePatterns": [ + "^org\\.apache\\.tomcat" + ], + "groupName": "apache-tomcat monorepo" + }, + { + "matchPackagePatterns": [ + "^io\\.micronaut" + ], + "groupName": "micronaut monorepo" + }, + { + "matchPackageNames": [ + "org.grails:grails-testing-support", + "org.grails:grails-web-testing-support", + "org.grails:grails-gorm-testing-support" + ], + "groupName": "grails-testing-support monorepo" + }, + { + "matchPackageNames": [ + "io.micronaut:micronaut-inject", + "io.micronaut:micronaut-runtime", + "io.micronaut:micronaut-inject-java", + "io.micronaut:micronaut-inject-groovy" + ], + "groupName": "Micronaut monorepo" + }, + { + "matchPackagePatterns": [ + "^io\\.micronaut\\.spring" + ], + "groupName": "Micronaut Spring monorepo" + }, + { + "matchPackagePatterns": [ + "^org\\.apache\\.maven\\.resolver" + ], + "groupName": "apache-maven-resolver monorepo" + } + ] +} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..9c6b707 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,70 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: + - '[1-9]+.[0-9]+.x' + pull_request: + # The branches below must be a subset of the branches above + branches: + - '[1-9]+.[0-9]+.x' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..bc03e0c --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,85 @@ +name: Java CI +on: + push: + branches: + - '[4-9]+.[0-9]+.x' + - '[3-9]+.[3-9]+.x' + pull_request: + branches: + - '[1-9]+.[0-9]+.x' + workflow_dispatch: +jobs: + build: + permissions: + contents: read # to fetch code (actions/checkout) + runs-on: ubuntu-latest + strategy: + matrix: + java: ['8'] + env: + WORKSPACE: ${{ github.workspace }} + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: ${{ matrix.java }} + - name: Run Build + id: build + uses: gradle/gradle-build-action@v2 + 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: build groovydoc + publish: + if: github.event_name == 'push' + needs: ["build"] + permissions: + contents: read # to fetch code (actions/checkout) + checks: write + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: 8 + - name: Publish Artifacts (repo.grails.org) + id: publish + uses: gradle/gradle-build-action@v2 + 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 }} + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + with: + arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish + invoke-third-party-workflows: + if: github.event_name == 'push' + needs: ["build", "publish"] + permissions: + contents: read # to fetch code (actions/checkout) + runs-on: ubuntu-latest + steps: + - name: Extract branch name + id: extract_branch + run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT + - name: Create Snapshot Message for the Workflow Dispatch + id: dispatch_message + run: echo "value={\"message\":\"New Core Snapshot $(date) - $GITHUB_SHA\"}" >> $GITHUB_OUTPUT + - name: Invoke the Java CI workflow in Grails Functional Tests + uses: benc-uk/workflow-dispatch@v1.2 + with: + workflow: Java CI + repo: grails/grails-functional-tests + ref: ${{ steps.extract_branch.outputs.value }} + token: ${{ secrets.GH_TOKEN }} + inputs: ${{ steps.dispatch_message.outputs.value }} diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml new file mode 100644 index 0000000..24cd924 --- /dev/null +++ b/.github/workflows/release-notes.yml @@ -0,0 +1,53 @@ +name: Changelog +on: + issues: + types: [closed,reopened] + push: + branches: + - master + - '[4-9]+.[0-9]+.x' + - '[3-9]+.[3-9]+.x' + workflow_dispatch: + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + release_notes: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check if it has release drafter config file + id: check_release_drafter + run: | + has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false") + echo ::set-output name=has_release_drafter::${has_release_drafter} + - name: Extract branch name + id: extract_branch + run: echo "value=${GITHUB_REF:11}" >> $GITHUB_STATE + # If it has release drafter: + - uses: release-drafter/release-drafter@v5 + if: steps.check_release_drafter.outputs.has_release_drafter == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + commitish: ${{ steps.extract_branch.outputs.value }} + # Otherwise: + - name: Export Gradle Properties + if: steps.check_release_drafter.outputs.has_release_drafter == 'false' + uses: micronaut-projects/github-actions/export-gradle-properties@master + - uses: micronaut-projects/github-actions/release-notes@master + if: steps.check_release_drafter.outputs.has_release_drafter == 'false' + id: release_notes + with: + token: ${{ secrets.GH_TOKEN }} + - uses: ncipollo/release-action@v1 + if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true' + with: + allowUpdates: true + commit: ${{ steps.release_notes.outputs.current_branch }} + draft: true + name: ${{ env.title }} ${{ steps.release_notes.outputs.next_version }} + tag: v${{ steps.release_notes.outputs.next_version }} + bodyFile: CHANGELOG.md + token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c130d3a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,127 @@ +name: Release +on: + release: + types: [published] +permissions: {} +jobs: + publish: + permissions: + contents: write # to create release + issues: write # to modify milestones + runs-on: ubuntu-latest + outputs: + release_version: ${{ steps.release_version.outputs.value }} + target_branch: ${{ steps.extract_branch.outputs.value }} + env: + GIT_USER_NAME: puneetbehl + GIT_USER_EMAIL: behlp@unityfoundation.io + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: '8' + - name: Set the current release version + id: release_version + run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT + - name: Run pre-release + uses: ./.github/actions/pre-release + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run Assemble + if: success() + id: assemble + uses: gradle/gradle-build-action@v2 + with: + arguments: assemble + 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: Upload Distribution + if: success() + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4 + with: + name: grails-${{ steps.release_version.outputs.value }}.zip + path: build/distributions/grails-${{ steps.release_version.outputs.value }}.zip + - name: Upload artifacts to the Github release + if: success() + id: upload_artifact + uses: Roang-zero1/github-upload-release-artifacts-action@master + with: + args: build/distributions/grails-${{ steps.release_version.outputs.value }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Generate secring file + env: + SECRING_FILE: ${{ secrets.SECRING_FILE }} + run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg + - name: Publish to Sonatype OSSRH + id: publish + uses: gradle/gradle-build-action@v2 + 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 }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }} + SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} + SECRING_FILE: ${{ secrets.SECRING_FILE }} + with: + arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository + - name: Run post-release + if: success() + uses: ./.github/actions/post-release + with: + token: ${{ secrets.GITHUB_TOKEN }} + env: + SNAPSHOT_SUFFIX: -SNAPSHOT + docs: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Prepare Input + id: prep_inputs + run: | + echo "value={\"grails_version\":\"$RELEASE_VERSION\"}" >> $GITHUB_OUTPUT + env: + RELEASE_VERSION: ${{ needs.publish.outputs.release_version }} + - name: Invoke grails-doc release workflow + uses: benc-uk/workflow-dispatch@v1.2 + with: + workflow: Release + repo: grails/grails-doc + ref: ${{ needs.publish.outputs.target_branch }} + token: ${{ secrets.GH_TOKEN }} + inputs: ${{ steps.prep_inputs.outputs.value }} + website: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Prepare Input + id: prep_inputs + run: | + echo "value={\"grails_version\":\"$RELEASE_VERSION\"}" >> $GITHUB_OUTPUT + env: + RELEASE_VERSION: ${{ needs.publish.outputs.release_version }} + - name: Invoke grails-static-website release workflow + if: success() + id: grails_static_website + uses: benc-uk/workflow-dispatch@v1.2 + with: + workflow: Release + repo: grails/grails-static-website + ref: master + token: ${{ secrets.GH_TOKEN }} + inputs: ${{ steps.prep_inputs.outputs.value }} \ No newline at end of file diff --git a/.github/workflows/retry-release.yml b/.github/workflows/retry-release.yml new file mode 100644 index 0000000..982964b --- /dev/null +++ b/.github/workflows/retry-release.yml @@ -0,0 +1,79 @@ +name: Retry Release +on: + workflow_dispatch: + inputs: + release: + description: The Grails Release (e.g. 5.0.3) + required: true + target_branch: + description: The Target Branch (e.g. 5.0.x) + required: true +permissions: {} +jobs: + release: + permissions: + contents: write # to create release + issues: read # to get closed issues + + runs-on: ubuntu-latest + env: + GIT_USER_NAME: puneetbehl + GIT_USER_EMAIL: behlp@unityfoundation.io + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: "v${{ github.event.inputs.release }}" + token: ${{ secrets.GH_TOKEN }} + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: 11 + - name: Extract Target Branch + id: extract_branch + run: | + echo $TARGET_BRANCH + echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT + env: + TARGET_BRANCH: ${{ github.event.inputs.target_branch }} + - name: Set the current release version + id: release_version + run: echo "release_version=${VERSION}" >> $GITHUB_OUTPUT + env: + VERSION: ${{ github.event.inputs.release }} + - name: Run Assemble + id: assemble + uses: gradle/gradle-build-action@v2 + with: + arguments: assemble + 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: Upload artifacts to the Github release + id: upload_artifact + if: steps.assemble.outcome == 'success' + uses: Roang-zero1/github-upload-release-artifacts-action@v3 + with: + created_tag: v${{ github.event.inputs.release }} + args: build/distributions/grails-${{ steps.release_version.outputs.release_version }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Message for the Grails Documentation Release + if: steps.assemble.outcome == 'success' + id: grails_docs_release_message + run: | + echo "value::{\"grails_version\":\"$RELEASE_VERSION\"}" >> $GITHUB_OUTPUT + env: + RELEASE_VERSION: ${{ steps.release_version.outputs.release_version }} + - name: Invoke grails-doc release workflow + if: steps.assemble.outcome == 'success' + id: grails_doc + uses: benc-uk/workflow-dispatch@v1.2 + with: + workflow: Release + repo: grails/grails-doc + ref: ${{ steps.extract_branch.outputs.value }} + token: ${{ secrets.GH_TOKEN }} + inputs: ${{ steps.grails_docs_release_message.outputs.value }}