Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,393 changes: 1,393 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 2
updates:
# Gradle dependencies and wrapper
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "deps"
open-pull-requests-limit: 10
groups:
gradle-dependencies:
patterns:
- "*"
exclude-patterns:
- "gradle"
ignore:
- dependency-name: "gradle"
versions: [ ">= 9" ]

# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "deps"
groups:
github-actions:
patterns:
- "*"
8 changes: 8 additions & 0 deletions .github/dependency-graph/external-references.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository#changing-the-used-by-package
# This file associates this repository with packages published to external registries (Maven Central)
# so that GitHub can display the correct "Used by" package on the repository page.
# The Package URL (purl) format is defined at https://github.com/package-url/purl-spec

version: 1
references:
- purl: pkg:maven/io.github.gpc/grails-plugin-template
7 changes: 7 additions & 0 deletions .github/projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
projects:
gpc:
- export
- grails-cookie
grails-plugins:
- grails-shiro
- grails-elasticsearch
134 changes: 134 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
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: 'improvement'
branch:
- '/improv\/.+/'
title:
- '/improv/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)\/.+/'
title:
- '/(chore|refactor|style|test|ci|perf|build)/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'
labels:
- 'feature'
- "type: enhancement"
- "type: new feature"
- "type: major"
- "type: minor"
- title: '💡 Improvements'
labels:
- 'improvement'
- "type: improvement"

- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bug'
- "type: bug"
- title: '📚 Documentation'
labels:
- 'docs'
- title: '🔧 Maintenance'
labels:
- 'maintenance'
- 'chore'
- 'refactor'
- 'style'
- 'test'
- 'ci'
- 'perf'
- 'build'
- "type: ci"
- "type: build"
- title: '⏪ Reverts'
labels:
- 'revert'
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
71 changes: 71 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":semanticCommitTypeAll(deps)",
"group:allNonMajor"
],
"labels": [
"deps"
],
"schedule": [
"before 6am on monday"
],
"gradle": {
"enabled": true,
"fileMatch": [
"(^|/)build\\.gradle$",
"(^|/)settings\\.gradle$",
"(^|/)gradle\\.properties$",
"build-logic/src/main/groovy/.*\\.gradle$"
]
},
"gradle-wrapper": {
"enabled": true
},
"github-actions": {
"enabled": true
},
"packageRules": [
{
"description": "Group all Grails dependencies together",
"matchPackagePatterns": [
"^org\\.apache\\.grails"
],
"groupName": "grails"
},
{
"description": "Group all Spring Boot dependencies together",
"matchPackagePatterns": [
"^org\\.springframework\\.boot"
],
"groupName": "spring-boot"
},
{
"description": "Group all GitHub Actions updates together",
"matchManagers": [
"github-actions"
],
"groupName": "github-actions"
},
{
"description": "Group all Spock/testing dependencies together",
"matchPackagePatterns": [
"^org\\.spockframework"
],
"groupName": "spock"
},
{
"description": "Automerge minor and patch updates for dev dependencies",
"matchUpdateTypes": [
"minor",
"patch"
],
"matchPackagePatterns": [
"^com\\.adarshr:gradle-test-logger-plugin"
],
"automerge": true
}
],
"ignoreDeps": []
}
25 changes: 25 additions & 0 deletions .github/scripts/prepare-sync-matrix.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env groovy
@Grab('org.apache.groovy:groovy-yaml')
import groovy.json.JsonOutput
import groovy.yaml.YamlSlurper

def projectsYml = new YamlSlurper().parse(new File('.github/projects.yml')) as Map
def filterProject = System.getenv('FILTER_PROJECT') ?: ''

def repos = []
(projectsYml.projects as Map<String, List<String>>).each { org, repoList ->
repoList.each { repo ->
if (!filterProject || filterProject == "${org}/${repo}") {
repos << [org: org, repo: repo]
}
}
}

def line = "repos=${JsonOutput.toJson(repos)}"
def outputFile = System.getenv('GITHUB_OUTPUT')
if (outputFile) {
new File(outputFile) << "${line}\n"
} else {
System.err.println "GITHUB_OUTPUT not set — would output: ${line}"
}
println "Matrix: ${repos.size()} repo(s)"
76 changes: 76 additions & 0 deletions .github/scripts/update-contributors.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/env groovy
// WARNING: Do not edit this file directly in your own repository.
// It is maintained in the grails-plugin-template repository.
// https://github.com/grails-plugins/grails-plugin-template/tree/main/.github/scripts
@Grab('org.apache.groovy:groovy-yaml')
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import groovy.yaml.YamlBuilder
import groovy.yaml.YamlSlurper

def token = System.getenv('GITHUB_TOKEN')
def repo = System.getenv('GITHUB_REPOSITORY')

if (!token) {
println "GITHUB_TOKEN not set — skipping contributor update"
System.exit(0)
}

def requestProps = [
Authorization : "token ${token}",
'User-Agent' : 'update-contributors-action',
Accept : 'application/vnd.github+json',
]

// 1. Fetch all contributors via REST (sorted by contributions desc, bots excluded)
def contributors = []
def page = 1
while (true) {
def url = "https://api.github.com/repos/${repo}/contributors?per_page=100&page=${page}"
def batch = new JsonSlurper().parseText(url.toURL().getText(requestProperties: requestProps)) as List
if (!batch) break
contributors.addAll(batch)
page++
}

def humans = contributors.findAll { it.type != 'Bot' }
if (!humans) {
println "No human contributors found — skipping update"
System.exit(0)
}

def nodeIds = humans*.node_id
def loginByNode = humans.collectEntries { [it.node_id, it.login] }

// 2. Fetch display names via GraphQL
def gqlQuery = 'query($ids:[ID!]!){nodes(ids:$ids){...on User{id name login}}}'
def gqlBody = JsonOutput.toJson([query: gqlQuery, variables: [ids: nodeIds]])

def conn = 'https://api.github.com/graphql'.toURL().openConnection() as HttpURLConnection
conn.doOutput = true
conn.requestMethod = 'POST'
conn.setRequestProperty('Authorization', "token ${token}")
conn.setRequestProperty('Content-Type', 'application/json')
conn.setRequestProperty('User-Agent', 'update-contributors-action')
conn.outputStream.withWriter { it << gqlBody }

def gqlNodes = new JsonSlurper().parseText(conn.inputStream.text).data.nodes
def nameByNode = gqlNodes.findAll().collectEntries { [(it.id): (it.name ?: it.login)] } as Map<String, String>

// 3. Build ordered map: login → display name (preserving contribution order)
def ordered = humans.collectEntries { c ->
def login = loginByNode[c.node_id]
[login, nameByNode[c.node_id] ?: login]
} as LinkedHashMap<String, String>

// 4. Update the contributors section in project.yml
def projectYmlFile = new File('project.yml')
def projectYml = new YamlSlurper().parse(projectYmlFile) as Map

projectYml.contributors = ordered

def yaml = new YamlBuilder()
yaml(projectYml)
projectYmlFile.text = yaml.toString()

println "Updated ${ordered.size()} contributors in project.yml"
Loading
Loading