Skip to content

Commit 85e2b3e

Browse files
committed
Upgraded to Grails 7. New github actions. Removed travis builder. Cleanup
1 parent ce6529e commit 85e2b3e

File tree

20 files changed

+715
-333
lines changed

20 files changed

+715
-333
lines changed

.github/renovate.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"extends": [
3+
"config:base"
4+
],
5+
"labels": ["type: dependency upgrade"],
6+
"packageRules": [
7+
{
8+
"matchUpdateTypes": ["major"],
9+
"enabled": false
10+
},
11+
{
12+
"matchPackagePatterns": ["*"],
13+
"allowedVersions": "!/SNAPSHOT$/"
14+
},
15+
{
16+
"matchPackagePatterns": [
17+
"^org\\.codehaus\\.groovy"
18+
],
19+
"groupName": "groovy monorepo"
20+
},
21+
{
22+
"matchPackageNames": [
23+
"org.grails:grails-bom",
24+
"org.grails:grails-bootstrap",
25+
"org.grails:grails-codecs",
26+
"org.grails:grails-console",
27+
"org.grails:grails-core",
28+
"org.grails:grails-databinding",
29+
"org.grails:grails-dependencies",
30+
"org.grails:grails-docs",
31+
"org.grails:grails-encoder",
32+
"org.grails:grails-gradle-model",
33+
"org.grails:grails-logging",
34+
"org.grails:grails-plugin-codecs",
35+
"org.grails:grails-plugin-controllers",
36+
"org.grails:grails-plugin-databinding",
37+
"org.grails:grails-plugin-datasource",
38+
"org.grails:grails-plugin-domain-class",
39+
"org.grails:grails-plugin-i18n",
40+
"org.grails:grails-plugin-interceptors",
41+
"org.grails:grails-plugin-mimetypes",
42+
"org.grails:grails-plugin-rest",
43+
"org.grails:grails-plugin-services",
44+
"org.grails:grails-plugin-url-mappings",
45+
"org.grails:grails-plugin-url-validation",
46+
"org.grails:grails-shell",
47+
"org.grails:grails-spring",
48+
"org.grails:grails-test",
49+
"org.grails:grails-validation",
50+
"org.grails:grails-web",
51+
"org.grails:grails-web-boot",
52+
"org.grails:grails-web-common",
53+
"org.grails:grails-web-databinding",
54+
"org.grails:grails-web-fileupload",
55+
"org.grails:grails-web-mvc",
56+
"org.grails:grails-web-url-mappings"
57+
],
58+
"groupName": "grails monorepo"
59+
}
60+
]
61+
}

.github/workflows/gradle.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "Java CI"
2+
on:
3+
push:
4+
branches:
5+
- '[4-9]+.[0-9]+.x'
6+
pull_request:
7+
branches:
8+
- '[4-9]+.[0-9]+.x'
9+
workflow_dispatch:
10+
jobs:
11+
test_project:
12+
name: "Test Project"
13+
runs-on: ubuntu-24.04
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
java: [17, 21]
18+
steps:
19+
- name: "📥 Checkout repository"
20+
uses: actions/checkout@v4
21+
- name: "☕️ Setup JDK"
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: ${{ matrix.java }}
25+
distribution: liberica
26+
- name: "🐘 Setup Gradle"
27+
uses: gradle/actions/setup-gradle@v4
28+
with:
29+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
30+
- name: "🏃 Run tests"
31+
run: ./gradlew check
32+
- name: "🏃 Run integration tests"
33+
working-directory: ./examples/testapp1
34+
run: ./gradlew integrationTest
35+
publish_snapshot:
36+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
37+
name: "Build Project and Publish Snapshot release"
38+
needs: test_project
39+
runs-on: ubuntu-24.04
40+
permissions:
41+
contents: write # updates gh-pages branch
42+
packages: write # publishes snapshot to GitHub Packages
43+
steps:
44+
- name: "📥 Checkout repository"
45+
uses: actions/checkout@v4
46+
- name: "☕️ Setup JDK"
47+
uses: actions/setup-java@v4
48+
with:
49+
java-version: 17
50+
distribution: liberica
51+
- name: "🐘 Setup Gradle"
52+
uses: gradle/actions/setup-gradle@v4
53+
with:
54+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
55+
- name: "🔨 Build Project"
56+
run: ./gradlew build
57+
- name: "📤 Publish Snapshot version to Artifactory (repo.grails.org)"
58+
env:
59+
GRAILS_PUBLISH_RELEASE: 'false'
60+
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
61+
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
62+
MAVEN_PUBLISH_URL: 'https://repo.grails.org/artifactory/plugins3-snapshots-local'
63+
run: ./gradlew publish
64+
- name: "📖 Generate Snapshot Documentation"
65+
run: ./gradlew docs
66+
- name: "📤 Publish Snapshot Documentation to Github Pages"
67+
uses: apache/grails-github-actions/deploy-github-pages@asf
68+
env:
69+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
GRADLE_PUBLISH_RELEASE: 'false'
71+
SOURCE_FOLDER: build/docs
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Release Drafter"
2+
on:
3+
issues:
4+
types: [closed, reopened]
5+
push:
6+
branches:
7+
- master
8+
- '[4-9]+.[0-9]+.x'
9+
pull_request:
10+
types: [opened, reopened, synchronize]
11+
pull_request_target:
12+
types: [opened, reopened, synchronize]
13+
jobs:
14+
update_release_draft:
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- name: "📝 Update Release Draft"
21+
uses: release-drafter/release-drafter@v6
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [ published ]
5+
env:
6+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7+
JAVA_VERSION: '17.0.15' # this must be a specific version for reproducible builds
8+
RELEASE_TAG_PREFIX: 'v'
9+
DOCUMENTATION: 'false'
10+
jobs:
11+
publish:
12+
permissions:
13+
packages: read # pre-release workflow
14+
contents: write # to create release
15+
issues: write # to modify milestones
16+
runs-on: ubuntu-latest
17+
outputs:
18+
release_version: ${{ steps.release_version.outputs.value }}
19+
extract_repository_name: ${{ steps.extract_repository_name.outputs.repository_name }}
20+
steps:
21+
- name: "📝 Store the current release version"
22+
id: release_version
23+
run: |
24+
export RELEASE_VERSION="${{ github.ref_name }}"
25+
export RELEASE_VERSION=${RELEASE_VERSION:${#RELEASE_TAG_PREFIX}}
26+
echo "Found Release Version: ${RELEASE_VERSION}"
27+
echo "value=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
28+
- name: "Extract repository name"
29+
id: extract_repository_name
30+
run: |
31+
echo "repository_name=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT
32+
- name: "📥 Checkout the repository"
33+
uses: actions/checkout@v4
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
ref: v${{ steps.release_version.outputs.value }}
37+
- name: 'Ensure Common Build Date' # to ensure a reproducible build
38+
run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> "$GITHUB_ENV"
39+
- name: "Ensure source files use common date"
40+
run: |
41+
find . -depth \( -type f -o -type d \) -exec touch -d "@${SOURCE_DATE_EPOCH}" {} +
42+
- name: "☕️ Setup JDK"
43+
uses: actions/setup-java@v4
44+
with:
45+
distribution: liberica
46+
java-version: ${{ env.JAVA_VERSION }}
47+
- name: "🐘 Setup Gradle"
48+
uses: gradle/actions/setup-gradle@v4
49+
- name: "⚙️ Run pre-release"
50+
uses: grails/github-actions/pre-release@asf
51+
env:
52+
RELEASE_VERSION: ${{ steps.release_version.outputs.value }}
53+
- name: "🔐 Generate key file for artifact signing"
54+
env:
55+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
56+
run: |
57+
printf "%s" "$SECRING_FILE" | base64 -d > "${{ github.workspace }}/secring.gpg"
58+
- name: "🧩 Run Assemble"
59+
id: assemble
60+
run: |
61+
./gradlew -U assemble -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg -Psigning.keyId=${{ secrets.SIGNING_KEY }}
62+
env:
63+
GRAILS_PUBLISH_RELEASE: 'true'
64+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
65+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
66+
- name: "📤 Publish to Maven Central"
67+
env:
68+
GRAILS_PUBLISH_RELEASE: 'true'
69+
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
70+
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
71+
NEXUS_PUBLISH_URL: 'https://ossrh-staging-api.central.sonatype.com/service/local/'
72+
NEXUS_PUBLISH_DESCRIPTION: '${{ steps.extract_repository_name.outputs.repository_name }}:${{ steps.release_version.outputs.value }}'
73+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
74+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
75+
run: >
76+
./gradlew
77+
-Psigning.keyId=${{ secrets.SIGNING_KEY }}
78+
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
79+
publishMavenPublicationToSonatypeRepository
80+
closeSonatypeStagingRepository
81+
- name: "Generate Build Date file"
82+
run: echo "$SOURCE_DATE_EPOCH" >> build/BUILD_DATE.txt
83+
- name: "Upload Build Date file"
84+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631
85+
with:
86+
files: build/BUILD_DATE.txt
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
release:
90+
needs: publish
91+
runs-on: ubuntu-latest
92+
environment: release
93+
permissions:
94+
contents: write
95+
issues: write
96+
pull-requests: write
97+
steps:
98+
- name: "📥 Checkout repository"
99+
uses: actions/checkout@v4
100+
with:
101+
token: ${{ secrets.GITHUB_TOKEN }}
102+
ref: v${{ needs.publish.outputs.release_version }}
103+
- name: "☕️ Setup JDK"
104+
uses: actions/setup-java@v4
105+
with:
106+
distribution: liberica
107+
java-version: ${{ env.JAVA_VERSION }}
108+
- name: "🐘 Setup Gradle"
109+
uses: gradle/actions/setup-gradle@v4
110+
- name: "📤 Release staging repository"
111+
env:
112+
GRAILS_PUBLISH_RELEASE: 'true'
113+
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
114+
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
115+
NEXUS_PUBLISH_URL: 'https://ossrh-staging-api.central.sonatype.com/service/local/'
116+
NEXUS_PUBLISH_DESCRIPTION: '${{ needs.publish.outputs.extract_repository_name }}:${{ needs.publish.outputs.release_version }}'
117+
run: >
118+
./gradlew
119+
findSonatypeStagingRepository
120+
releaseSonatypeStagingRepository
121+
- name: "📖 Generate Documentation"
122+
if: ${{ env.DOCUMENTATION != 'false' }}
123+
run: ./gradlew docs
124+
- name: "📤 Publish Documentation to Github Pages"
125+
if: ${{ env.DOCUMENTATION != 'false' }}
126+
uses: apache/grails-github-actions/deploy-github-pages@asf
127+
env:
128+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
GRADLE_PUBLISH_RELEASE: 'true'
130+
SOURCE_FOLDER: build/docs
131+
VERSION: ${{ needs.publish.outputs.release_version }}
132+
- name: "⚙️ Run post-release"
133+
uses: apache/grails-github-actions/post-release@asf

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

LICENSE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@
178178
APPENDIX: How to apply the Apache License to your work.
179179

180180
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "{}"
181+
boilerplate notice, with the fields enclosed by brackets "[]"
182182
replaced with your own identifying information. (Don't include
183183
the brackets!) The text should be enclosed in the appropriate
184184
comment syntax for the file format. We also recommend that a
185185
file or class name and description of purpose be included on the
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright {yyyy} {name of copyright owner}
189+
Copyright [yyyy] [name of copyright owner]
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

0 commit comments

Comments
 (0)