Skip to content

Commit

Permalink
Grace Turbo Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed Feb 7, 2024
0 parents commit 9cb055d
Show file tree
Hide file tree
Showing 19 changed files with 880 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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
79 changes: 79 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Grace CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
workflow_dispatch:
jobs:
build:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11']
env:
WORKSPACE: ${{ github.workspace }}
steps:
- name: Checkout repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- 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@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: build -x test
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
- 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@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 }}
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
29 changes: 29 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Grace Changelog
on:
issues:
types: [closed,reopened]
push:
branches:
- main
workflow_dispatch:
jobs:
release_notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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 ::set-output name=value::${GITHUB_REF:11}
# If it has release drafter:
- uses: release-drafter/release-drafter@v5.19.0
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{ steps.extract_branch.outputs.value }}
filter-by-commitish: true
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Grace Release

on:
push:
tags:
- v*

permissions:
contents: write

jobs:
create_draft_release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Create draft release
run: |
gh release create \
--repo ${{ github.repository }} \
--title ${{ github.ref_name }} \
--notes '' \
--draft \
${{ github.ref_name }}
release_and_publish:
needs: create_draft_release
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11']
env:
GIT_USER_NAME: rainboyan
GIT_USER_EMAIL: rain@rainboyan.com
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Extract Target Branch
id: extract_branch
run: |
echo "Determining Target Branch"
TARGET_BRANCH=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'`
echo $TARGET_BRANCH
echo ::set-output name=value::${TARGET_BRANCH}
- name: Set the current release version
id: release_version
run: echo "release_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Generate secring file
id: secring
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: Publish to Sonatype OSSRH
id: publish
if: steps.secring.outcome == 'success'
uses: gradle/gradle-build-action@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 }}
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
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Thumbs.db
.DS_Store
.gradle
build/
out/
.idea
*.iml
*.ipr
*.iws
.project
.settings
.classpath
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Grace with Turbo

[Grace](https://github.com/graceframework/grace-framework) is an open-source and powerful One-Person web application Framework to help developers quickly build Spring Boot applications written in the Groovy programing language. [Turbo](https://turbo.hotwired.dev) gives you the speed of a single-page web application without having to write any JavaScript.

This plugin will help you to develop Grace app with Turo.


## Links

- [Grace Framework](https://github.com/graceframework/grace-framework)
- [Hotwire Turbo](https://turbo.hotwired.dev)
Empty file added app/assets/.gitkeep
Empty file.
44 changes: 44 additions & 0 deletions app/conf/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
grails:
profile: web-plugin
codegen:
defaultPackage: org.graceframework.plugin
gorm:
reactor:
# Whether to translate GORM events into Reactor events
# Disabled by default for performance reasons
events: false
info:
app:
name: '@info.app.name@'
version: '@info.app.version@'
grailsVersion: '@info.app.grailsVersion@'
spring:
jmx:
unique-names: true
main:
banner-mode: "console"
groovy:
template:
check-template-location: false
devtools:
restart:
additional-exclude:
- '*.gsp'
- '**/*.gsp'
- '*.gson'
- '**/*.gson'
- 'logback.groovy'
- '*.properties'
environments:
development:
management:
endpoints:
enabled-by-default: true
web:
base-path: '/actuator'
exposure:
include: '*'
production:
management:
endpoints:
enabled-by-default: false
19 changes: 19 additions & 0 deletions app/conf/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>UTF-8</charset>
<pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern>
</encoder>
</appender>

<root level="info">
<appender-ref ref="STDOUT" />
</root>
<logger name="org.hibernate.orm.deprecation" level="error" />
<logger name="org.graceframework.plugin.Application" level="debug" />
</configuration>
13 changes: 13 additions & 0 deletions app/init/org/graceframework/plugin/Application.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.graceframework.plugin

import grails.boot.Grails
import grails.plugins.metadata.PluginSource

@PluginSource
class Application {

static void main(String[] args) {
Grails.run(Application, args)
}

}
11 changes: 11 additions & 0 deletions app/init/org/graceframework/plugin/BootStrap.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.graceframework.plugin

class BootStrap {

def init = { servletContext ->
}

def destroy = {
}

}
Loading

0 comments on commit 9cb055d

Please sign in to comment.