-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cac6d3e
Showing
27 changed files
with
1,447 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [email protected] | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Grace with Htmx | ||
|
||
Grace Plugin for using Grace app with htmx. | ||
|
||
|
||
## Usage | ||
|
||
Add dependency to the `build.gradle`, | ||
|
||
```gradle | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
implementation "org.graceframework.plugins:htmx:0.0.1-SNAPSHOT" | ||
} | ||
``` | ||
|
||
Htmx plugin supports controller-specific `withFormat()` method, | ||
|
||
```groovy | ||
class BookController { | ||
def list() { | ||
def books = Book.list() | ||
withFormat { | ||
htmx { | ||
render(template: "book", model: [bookList: books]) | ||
} | ||
json { | ||
render books as JSON | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Also, this plugin supports extendsions for Grails Request and Response, | ||
|
||
```groovy | ||
// You can get htmx request headers from Grails Request | ||
request.htmx.boosted == request.getHeader('HX-Boosted') | ||
request.htmx.target == request.getHeader('HX-Target') | ||
// Check htmx request? | ||
if (request.htmx as boolean) { // or use request.isHtmx() | ||
template = 'book-detail' | ||
} | ||
// You can set htmx response headers in Grails | ||
response.htmx.trigger = 'itemAdded' | ||
``` | ||
|
||
## Example | ||
|
||
* [Grace Htmx TodoMVC](https://github.com/grace-guides/grace-htmx-todomvc) | ||
|
||
## Development | ||
|
||
### Build from source | ||
|
||
``` | ||
git clone https://github.com/grace-plugins/grace-htmx.git | ||
cd grace-htmx | ||
./gradlew publishToMavenLocal | ||
``` | ||
|
||
## Support Grace Version | ||
|
||
* Grace 2022.0.0 | ||
|
||
## Roadmap | ||
|
||
### 1.x | ||
|
||
* Htmx 1.9 | ||
|
||
### 2.x | ||
|
||
* Htmx 2.0 | ||
|
||
## License | ||
|
||
This plugin is available as open source under the terms of the [APACHE LICENSE, VERSION 2.0](http://apache.org/Licenses/LICENSE-2.0) | ||
|
||
## Links | ||
|
||
- [Grace Website](https://github.com/graceframework/grace-framework) | ||
- [Grace Plugins](https://github.com/grace-plugins) | ||
- [Grace Htmx Plugin](https://github.com/grace-plugins/grace-htmx) | ||
- [Grace Htmx TodoMVC](https://github.com/grace-guides/grace-htmx-todomvc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
grails: | ||
profile: plugin | ||
codegen: | ||
defaultPackage: org.graceframework.plugin.htmx | ||
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 |
Oops, something went wrong.