Skip to content

Commit 6acda68

Browse files
authored
Merge pull request #11 from grails/githubWorkflow
Upgrade Project
2 parents 8237946 + dbb12ef commit 6acda68

File tree

14 files changed

+470
-238
lines changed

14 files changed

+470
-238
lines changed

.github/release-drafter.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name-template: $RESOLVED_VERSION
2+
tag-template: v$RESOLVED_VERSION
3+
categories:
4+
- title: 🚀 Features
5+
labels:
6+
- "type: enhancement"
7+
- "type: new feature"
8+
- "type: major"
9+
- title: 🚀 Bug Fixes/Improvements
10+
labels:
11+
- "type: improvement"
12+
- "type: bug"
13+
- "type: minor"
14+
- title: 🛠 Dependency upgrades
15+
labels:
16+
- "type: dependency upgrade"
17+
- "dependencies"
18+
- title: ⚙️ Build/CI
19+
labels:
20+
- "type: ci"
21+
- "type: build"
22+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
23+
filter-by-commitish: true
24+
version-resolver:
25+
major:
26+
labels:
27+
- 'type: major'
28+
minor:
29+
labels:
30+
- 'type: minor'
31+
patch:
32+
labels:
33+
- 'type: patch'
34+
default: patch
35+
template: |
36+
## What's Changed
37+
38+
$CHANGES
39+
40+
## Contributors
41+
42+
$CONTRIBUTORS
File renamed without changes.

.github/workflows/gradle.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Java CI
2+
on:
3+
push:
4+
branches:
5+
- '[2-9]+.[0-9]+.x'
6+
pull_request:
7+
branches:
8+
- '[2-9]+.[0-9]+.x'
9+
workflow_dispatch:
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
java: ['8']
16+
env:
17+
WORKSPACE: ${{ github.workspace }}
18+
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
19+
steps:
20+
- name: Print Dispatch Information
21+
if: github.event_name == 'workflow_dispatch'
22+
env:
23+
DISPATCH_INFORMATION: ${{ github.event.inputs.message }}
24+
run: echo $DISPATCH_INFORMATION
25+
- uses: actions/checkout@v3
26+
- name: Set up JDK
27+
uses: actions/setup-java@v3
28+
with:
29+
distribution: 'adopt'
30+
java-version: ${{ matrix.java }}
31+
- name: Run Tests
32+
if: github.event_name == 'pull_request'
33+
id: tests
34+
uses: gradle/gradle-build-action@v2
35+
with:
36+
arguments: check
37+
env:
38+
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
39+
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
40+
- name: Run Build
41+
if: github.event_name == 'push'
42+
id: build
43+
uses: gradle/gradle-build-action@v2
44+
env:
45+
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
46+
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
47+
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
48+
with:
49+
arguments: build
50+
- name: Publish Test Report
51+
if: steps.build.outcome == 'failure' || steps.tests.outcome == 'failure'
52+
uses: scacap/action-surefire-report@v1
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
report_paths: '**/build/test-results/test/TEST-*.xml'
56+
- name: Publish to repo.grails.org
57+
uses: gradle/gradle-build-action@v2
58+
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
59+
env:
60+
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
61+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
62+
with:
63+
arguments: publish
64+
- name: Generate Documentation
65+
id: docs
66+
uses: gradle/gradle-build-action@v2
67+
if: success() && github.event_name == 'push' && matrix.java == '8'
68+
with:
69+
arguments: docs
70+
- name: Publish to Github Pages
71+
if: steps.publish.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
72+
uses: micronaut-projects/github-pages-deploy-action@master
73+
env:
74+
TARGET_REPOSITORY: ${{ github.repository }}
75+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
76+
BRANCH: gh-pages
77+
FOLDER: build/docs
78+
DOC_FOLDER: gh-pages
79+
COMMIT_EMAIL: behlp@objectcomputing.com
80+
COMMIT_NAME: Puneet Behl
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Changelog
2+
on:
3+
issues:
4+
types: [closed,reopened]
5+
push:
6+
branches:
7+
- '[2-9]+.[0-9]+.x'
8+
workflow_dispatch:
9+
jobs:
10+
release_notes:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Check if it has release drafter config file
15+
id: check_release_drafter
16+
run: |
17+
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
18+
echo ::set-output name=has_release_drafter::${has_release_drafter}
19+
- name: Extract branch name
20+
id: extract_branch
21+
run: echo ::set-output name=value::${GITHUB_REF:11}
22+
# If it has release drafter:
23+
- uses: release-drafter/release-drafter@v5
24+
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
27+
with:
28+
commitish: ${{ steps.extract_branch.outputs.value }}
29+
# Otherwise:
30+
- name: Export Gradle Properties
31+
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
32+
uses: micronaut-projects/github-actions/export-gradle-properties@master
33+
- uses: micronaut-projects/github-actions/release-notes@master
34+
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
35+
id: release_notes
36+
with:
37+
token: ${{ secrets.GH_TOKEN }}
38+
- uses: ncipollo/release-action@v1
39+
if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true'
40+
with:
41+
allowUpdates: true
42+
commit: ${{ steps.release_notes.outputs.current_branch }}
43+
draft: true
44+
name: ${{ env.title }} ${{ steps.release_notes.outputs.next_version }}
45+
tag: v${{ steps.release_notes.outputs.next_version }}
46+
bodyFile: CHANGELOG.md
47+
token: ${{ secrets.GH_TOKEN }}

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
java: ['8']
11+
env:
12+
GIT_USER_NAME: puneetbehl
13+
GIT_USER_EMAIL: behlp@objectcomputing.com
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
with:
18+
token: ${{ secrets.GH_TOKEN }}
19+
- uses: gradle/wrapper-validation-action@v1
20+
- name: Set up JDK
21+
uses: actions/setup-java@v3
22+
with:
23+
distribution: 'adopt'
24+
java-version: ${{ matrix.java }}
25+
- name: Set the current release version
26+
id: release_version
27+
run: echo ::set-output name=release_version::${GITHUB_REF:11}
28+
- name: Run pre-release
29+
uses: micronaut-projects/github-actions/pre-release@master
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Generate secring file
33+
env:
34+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
35+
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
36+
- name: Publish to Sonatype OSSRH
37+
id: publish
38+
uses: gradle/gradle-build-action@v2
39+
env:
40+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
41+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
42+
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
43+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
44+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
45+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
46+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
47+
with:
48+
arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository
49+
- name: Publish Documentation
50+
id: docs
51+
if: steps.publish.outcome == 'success'
52+
uses: gradle/gradle-build-action@v2
53+
with:
54+
arguments: docs
55+
- name: Export Gradle Properties
56+
uses: micronaut-projects/github-actions/export-gradle-properties@master
57+
- name: Publish to Github Pages
58+
if: steps.docs.outcome == 'success'
59+
uses: micronaut-projects/github-pages-deploy-action@master
60+
env:
61+
BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }}
62+
TARGET_REPOSITORY: ${{ github.repository }}
63+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
64+
BRANCH: gh-pages
65+
FOLDER: build/docs
66+
DOC_FOLDER: gh-pages
67+
COMMIT_EMAIL: behlp@objectcomputing.com
68+
COMMIT_NAME: Puneet Behl
69+
VERSION: ${{ steps.release_version.outputs.release_version }}
70+
- name: Run post-release
71+
if: success()
72+
uses: micronaut-projects/github-actions/post-release@master
73+
with:
74+
token: ${{ secrets.GITHUB_TOKEN }}
75+
env:
76+
SNAPSHOT_SUFFIX: -SNAPSHOT

.travis.yml

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

build.gradle

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,24 @@
11
buildscript {
2-
ext {
3-
grailsVersion = project.grailsVersion
4-
}
52
repositories {
6-
mavenLocal()
73
maven { url "https://repo.grails.org/grails/core" }
84
}
95
dependencies {
10-
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
6+
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
7+
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.12'
118
}
129
}
1310

14-
plugins {
15-
id 'org.asciidoctor.convert' version '1.5.3'
16-
}
17-
18-
version "2.0.0.BUILD-SNAPSHOT"
19-
//version "2.0.0.M2"
11+
version project.projectVersion
2012
group "org.grails.plugins"
2113

2214
apply plugin: 'java-library'
2315
apply plugin:"eclipse"
2416
apply plugin:"idea"
17+
apply plugin: "org.asciidoctor.convert"
2518
apply plugin:"org.grails.grails-plugin"
26-
apply plugin:"org.grails.grails-plugin-publish"
27-
28-
ext {
29-
grailsVersion = project.grailsVersion
30-
gradleWrapperVersion = project.gradleWrapperVersion
31-
}
19+
apply plugin:"org.grails.internal.grails-plugin-publish"
3220

3321
repositories {
34-
mavenLocal()
3522
maven { url "https://repo.grails.org/grails/core" }
3623
}
3724

@@ -48,18 +35,18 @@ configurations.all {
4835
}
4936

5037
dependencies {
51-
provided "org.springframework.boot:spring-boot-starter-logging"
52-
provided "org.springframework.boot:spring-boot-autoconfigure"
53-
provided "org.grails:grails-core"
54-
profile "org.grails.profiles:plugin"
55-
provided "org.grails:grails-gorm-testing-support"
38+
api "org.springframework.boot:spring-boot-starter-logging"
39+
api "org.springframework.boot:spring-boot-autoconfigure"
40+
api "org.grails:grails-core"
41+
api "org.grails.profiles:plugin"
42+
api "org.grails:grails-gorm-testing-support"
5643
api("de.flapdoodle.embed:de.flapdoodle.embed.mongo:2.2.0") {
5744
exclude group: "commons-io"
5845
exclude group: "org.apache.commons", module: "commons-lang3"
5946
exclude group: "net.java.dev.jna"
6047
exclude group: "org.slf4j"
6148
}
62-
provided "org.grails.plugins:mongodb"
49+
api "org.grails.plugins:mongodb"
6350
documentation "org.codehaus.groovy:groovy-all"
6451
}
6552

@@ -90,7 +77,7 @@ asciidoctor {
9077
'sourcedir' : "${projectDir}/src/main/groovy"
9178
}
9279

93-
task apidocs(type: Groovydoc) {
80+
def apidocs = tasks.register("apidocs", Groovydoc) {
9481
source project.files('src/main/groovy')
9582

9683
destinationDir = new File(buildDir, 'docs/api')
@@ -101,7 +88,9 @@ task apidocs(type: Groovydoc) {
10188
groovyClasspath = configurations.documentation
10289
}
10390

104-
task docs(type:Copy, dependsOn:[apidocs, asciidoctor]) {
91+
def docs = tasks.register("docs", Copy) {
92+
type = "documentation"
93+
dependsOn = ["apidocs", "asciidoctor"]
10594
from "$buildDir/asciidoc/html5"
10695
into "$buildDir/docs"
10796
}
@@ -124,4 +113,20 @@ tasks.withType(GroovyCompile) {
124113
}
125114
}
126115

116+
tasks.withType(Test) {
117+
useJUnitPlatform()
118+
}
119+
120+
test {
121+
testLogging {
122+
events "passed", "skipped", "failed"
123+
124+
showExceptions true
125+
exceptionFormat "full"
126+
showCauses true
127+
showStackTraces true
128+
}
129+
}
130+
131+
127132
bootJar.enabled = false

gradle.properties

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
gormVersion=7.1.0.M2
2-
grailsVersion=4.1.0.M2
3-
gradleWrapperVersion=3.5
1+
projectVersion=2.0.0-SNAPSHOT
2+
gormVersion=7.2.1
3+
grailsVersion=5.1.8
4+
grailsGradlePluginVersion=5.1.4
45
groovyVersion=3.0.5
56
mongodbJavaDriverVersion=4.0.3
7+
org.gradle.parallel=true
8+
org.gradle.caching=true
9+
org.gradle.daemon=true

gradle/wrapper/gradle-wrapper.jar

626 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)