Skip to content

Commit 9bde0c3

Browse files
authored
Merge pull request #1 from gpc/move-to-gpc
Move to gpc
2 parents 12b4cd0 + cb875ad commit 9bde0c3

File tree

6 files changed

+208
-43
lines changed

6 files changed

+208
-43
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Build
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up JDK 8
20+
uses: actions/setup-java@v2
21+
with:
22+
java-version: '8'
23+
distribution: 'adopt'
24+
cache: gradle
25+
- name: Grant execute permission for gradlew
26+
run: chmod +x gradlew
27+
- name: Build with Gradle
28+
run: ./gradlew build

.github/workflows/release.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [ published ]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
env:
9+
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
10+
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
with:
15+
token: ${{ secrets.GH_TOKEN }}
16+
- uses: gradle/wrapper-validation-action@v1
17+
- name: Set up JDK
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 8
21+
- name: Get latest release version number
22+
id: get_version
23+
uses: battila7/get-version-action@v2
24+
- name: Run pre-release
25+
uses: micronaut-projects/github-actions/pre-release@master
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Publish to Sonatype OSSRH
29+
env:
30+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
31+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
32+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
33+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
34+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
35+
SECRING_FILE: ${{ secrets.SECRING_FILE }}
36+
RELEASE_VERSION: ${{ steps.get_version.outputs.version-without-v }}
37+
run: |
38+
echo "${SECRING_FILE}" | base64 -d > "${GITHUB_WORKSPACE}/secring.gpg"
39+
echo "Publishing Artifacts for $RELEASE_VERSION"
40+
(set -x; ./gradlew -Pversion="${RELEASE_VERSION}" -Psigning.secretKeyRingFile="${GITHUB_WORKSPACE}/secring.gpg" publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon)
41+
- name: Bump patch version by one
42+
uses: actions-ecosystem/action-bump-semver@v1
43+
id: bump_semver
44+
with:
45+
current_version: ${{steps.get_version.outputs.version-without-v }}
46+
level: patch
47+
- name: Set version in gradle.properties
48+
env:
49+
NEXT_VERSION: ${{ steps.bump_semver.outputs.new_version }}
50+
run: |
51+
echo "Preparing next snapshot"
52+
./gradlew snapshotVersion -Pversion="${NEXT_VERSION}"
53+
- name: Commit & Push changes
54+
uses: actions-js/push@master
55+
with:
56+
github_token: ${{ secrets.GITHUB_TOKEN }}
57+
author_name: ${{ secrets.GIT_USER_NAME }}
58+
author_email: $${ secrets.GIT_USER_EMAIL }}
59+
message: 'Set version to next SNAPSHOT'
60+
- name: Build documentation
61+
env:
62+
RELEASE_VERSION: ${{ steps.get_version.outputs.version-without-v }}
63+
run: |
64+
./gradlew asciidoctor -Pversion="${RELEASE_VERSION}"
65+
- name: Export Gradle Properties
66+
uses: micronaut-projects/github-actions/export-gradle-properties@master
67+
- name: Publish to Github Pages
68+
if: success()
69+
uses: micronaut-projects/github-pages-deploy-action@master
70+
env:
71+
BETA: ${{ steps.get_version.outputs.isPrerelase }}
72+
TARGET_REPOSITORY: ${{ github.repository }}
73+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
74+
BRANCH: gh-pages
75+
FOLDER: build/asciidoc
76+
DOC_FOLDER: latest
77+
COMMIT_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
78+
COMMIT_NAME: ${{ secrets.GIT_USER_NAME }}
79+
VERSION: ${{ steps.get_version.outputs.version-without-v }}
80+
- name: Run post-release
81+
if: success()
82+
uses: micronaut-projects/github-actions/post-release@master
83+
with:
84+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Mark stale issues and pull requests
2+
3+
on:
4+
schedule:
5+
- cron: '00 06 * * 1'
6+
7+
jobs:
8+
stale:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
15+
steps:
16+
- uses: actions/stale@v3
17+
with:
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
stale-issue-message: 'This issue looks like it is stale and therefor it is in risk of being closed with no further action.'
20+
stale-pr-message: 'This pull request looks like it is stale and therefor it is in risk of being closed with no further action.'
21+
stale-issue-label: 'no-issue-activity'
22+
stale-pr-label: 'no-pr-activity'
23+
days-before-stale: 180

README.md

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The Grails Asynchronous Mail plugin
22
====================================
33

4-
[![Build Status](https://travis-ci.org/kefirfromperm/grails-asynchronous-mail.svg?branch=master)](https://travis-ci.org/kefirfromperm/grails-asynchronous-mail) [![OpenHUB](https://openhub.net/p/grails-asynchronous-mail/widgets/project_thin_badge?format=gif)](https://openhub.net/p/grails-asynchronous-mail)
4+
[![Build](https://github.com/gpc/grails-asynchronous-mail/actions/workflows/build.yml/badge.svg)](https://github.com/gpc/grails-asynchronous-mail/actions/workflows/build.yml)
55

66
Description
77
-----------
@@ -11,16 +11,14 @@ database with Grails domain classes and sends them by a scheduled Quartz job. Ma
1111
the `sendAsynchronousMail` (or `sendMail`) method returning instantly, is not waiting for the mail to be actually sent. If
1212
the SMTP server isn't available, or other errors occur, the plugin can be set to retry later.
1313

14-
The plugin depends on the [quartz](https://grails.org/plugins.html#plugin/quartz) and the [mail](https://grails.org/plugins.html#plugin/mail) plugins. You also need a persistence provider plugin, [hibernate5](https://plugins.grails.org/plugin/grails/hibernate5) (or the appropriate version of hibernate for previous grails versions) and [mongodb](https://plugins.grails.org/plugin/grails/mongodb) are supported.
14+
The plugin depends on the [quartz](https://plugins.grails.org/plugin/grails/quartz) and the [mail](https://plugins.grails.org/plugin/grails/mail) plugins. You also need a persistence provider plugin, [hibernate5](https://plugins.grails.org/plugin/grails/hibernate5) (or the appropriate version of hibernate for previous grails versions) and [mongodb](https://plugins.grails.org/plugin/grails/mongodb) are supported.
1515

1616
Links
1717
-----
1818

19-
* The plugin page: <https://plugins.grails.org/plugin/kefirsf/asynchronous-mail>
20-
* The VCS repository (GitHub): <https://github.com/kefirfromperm/grails-asynchronous-mail>
21-
* The issue tracker (GitHub): <https://github.com/kefirfromperm/grails-asynchronous-mail/issues>
22-
* The repository package (BinTray): <https://bintray.com/kefirsf/plugins/asynchronous-mail/>
23-
* The page at OpenHUB: <https://www.openhub.net/p/grails-asynchronous-mail>
19+
* The plugin page: <https://plugins.grails.org/plugin/grails/asynchronous-mail>
20+
* The VCS repository (GitHub): <https://github.com/gpc/grails-asynchronous-mail>
21+
* The issue tracker (GitHub): <https://github.com/gpc/grails-asynchronous-mail/issues>
2422

2523
Installation
2624
------------
@@ -115,22 +113,22 @@ Next, change your sendMail call.
115113
asyncMailService.sendMail {
116114
// Mail parameters
117115
118-
subject 'Test';
119-
html '<body><u>Test</u></body>';
120-
attachBytes 'test.txt', 'text/plain', byteBuffer;
116+
subject 'Test'
117+
html '<body><u>Test</u></body>'
118+
attachBytes 'test.txt', 'text/plain', byteBuffer
121119
122120
// Additional asynchronous parameters (optional)
123121
beginDate new Date(System.currentTimeMillis()+60000) // Starts after one minute, default current date
124122
endDate new Date(System.currentTimeMillis()+3600000) // Must be sent in one hour, default infinity
125-
maxAttemptsCount 3; // Max 3 attempts to send, default 1
126-
attemptInterval 300000; // Minimum five minutes between attempts, default 300000 ms
127-
delete true; // Marks the message for deleting after sent
128-
immediate true; // Run the send job after the message was created
129-
priority 10; // If priority is greater then message will be sent faster
123+
maxAttemptsCount 3 // Max 3 attempts to send, default 1
124+
attemptInterval 300000 // Minimum five minutes between attempts, default 300000 ms
125+
delete true // Marks the message for deleting after sent
126+
immediate true // Run the send job after the message was created
127+
priority 10 // If priority is greater then message will be sent faster
130128
}
131129
```
132130

133-
Also see the sample application at <https://github.com/kefirfromperm/grails-asynchronous-mail-sample>.
131+
Also see the sample application at <https://github.com/kefirfromperm/grails-asynchronous-mail-sample> (Grails 3).
134132

135133
The AsynchronousMailController and views
136134
----------------------------------------
@@ -146,45 +144,31 @@ Logging
146144

147145
To enable full logging for the plugin just add the following lines to `/grails-app/conf/logback.groovy`.
148146
```groovy
149-
...
147+
//...
150148
// Enable Asynchronous Mail plugin logging
151149
logger('grails.app.jobs.grails.plugin.asyncmail', TRACE, ['STDOUT'])
152150
logger('grails.app.services.grails.plugin.asyncmail', TRACE, ['STDOUT'])
153151
logger('grails.plugin.asyncmail', TRACE, ['STDOUT'])
154152
155153
// Enable Quartz plugin logging
156154
logger('grails.plugins.quartz', DEBUG, ['STDOUT'])
157-
...
155+
//...
158156
```
159157

160158
Indexes
161159
-------
162160

163-
I recommend to create an index on the `async_mail_mess.status` column. It's result of my heuristic observations. Only DBA have to create indexes anyway.
161+
A recommendation is to create an index on the `async_mail_mess.status` column. It's result of my heuristic observations. Only DBA have to create indexes anyway.
164162

165163
Issue tracking
166164
--------------
167165

168-
You can report bugs on [GitHub](https://github.com/kefirfromperm/grails-asynchronous-mail/issues?state=open).
169-
You also can ask me questions by email [[email protected]](mailto:[email protected]).
166+
You can report bugs on [GitHub](https://github.com/gpc/grails-asynchronous-mail/issues?state=open).
167+
You also can ask questions in the [Grails Community Slack Channels](https://slack.grails.org/).
170168
Please enable logs and attach them to your issue.
171169

172-
Please review this project at [OpenHUB](https://www.openhub.net/p/grails-asynchronous-mail).
173-
174170
Contribution
175171
------------
176172

177173
If you want to contribute to the plugin just open a pull request to the repository
178-
<https://github.com/kefirfromperm/grails-asynchronous-mail>.
179-
180-
Unit tests are very very sweet things. They help us to find bugs and to modify code without adding new bugs. It's very
181-
interesting to see how they work. I like to see how they work. What is better than unit tests? More unit tests!
182-
Unit tests are good!
183-
184-
And comments... Comments are good also. They are not as good as unit tests but they are definitely good. If you known
185-
Chinese or Arabic it's good. Seriously. It's awesome! But I don't speak them. So write comments in English.
186-
187-
Donation
188-
--------
189-
190-
If you want to give me a beer just send some money to <https://www.paypal.me/kefir>
174+
<https://github.com/gpc/grails-asynchronous-mail>.

build.gradle

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
buildscript {
22
repositories {
33
maven { url "https://repo.grails.org/grails/core" }
4+
maven { url "https://plugins.gradle.org/m2" }
45
}
56
dependencies {
67
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
78
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.3.4"
89
classpath "org.grails.plugins:hibernate5:7.2.0"
10+
classpath "io.github.gradle-nexus:publish-plugin:1.0.0"
911
}
1012
}
1113

12-
version "3.1.0"
13-
group "org.grails.plugins"
14+
group "io.github.gpc"
1415

1516
apply plugin: "eclipse"
1617
apply plugin: "idea"
1718
apply plugin: "org.grails.grails-plugin"
1819
apply plugin: "asset-pipeline"
1920
apply plugin: "org.grails.grails-gsp"
2021
apply plugin: "maven-publish"
21-
//apply plugin: "signing"
22+
apply plugin: "signing"
23+
apply plugin: "io.github.gradle-nexus.publish-plugin"
2224

2325
repositories {
2426
maven { url "https://repo.grails.org/grails/core" }
@@ -121,7 +123,7 @@ publishing {
121123
pom {
122124
name = 'Grails Asynchronous Mail Plugin'
123125
description = 'The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job.'
124-
url = 'https://github.com/matrei/grails-asynchronous-mail'
126+
url = 'https://github.com/gpc/grails-asynchronous-mail'
125127
licenses {
126128
license {
127129
name = 'The Apache License, Version 2.0'
@@ -187,11 +189,54 @@ publishing {
187189
}
188190
}
189191
scm {
190-
connection = 'scm:git:git://github.com/matrei/grails-asynchronous-mail.git'
191-
developerConnection = 'scm:git:ssh://github.com:matrei/grails-asynchronous-mail.git'
192-
url = 'https://github.com/matrei/grails-asynchronous-mail'
192+
connection = 'scm:git:git://github.com/gpc/grails-asynchronous-mail.git'
193+
developerConnection = 'scm:git:ssh://github.com:gpc/grails-asynchronous-mail.git'
194+
url = 'https://github.com/gpc/grails-asynchronous-mail'
193195
}
194196
}
195197
}
196198
}
197199
}
200+
201+
ext."signing.keyId" = project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY_ID')
202+
ext."signing.password" = project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE')
203+
ext."signing.secretKeyRingFile" = project.findProperty('signing.secretKeyRingFile') ?: (System.getenv('SIGNING_PASSPHRASE') ?: "${System.getProperty('user.home')}/.gnupg/secring.gpg")
204+
205+
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
206+
207+
afterEvaluate {
208+
signing {
209+
required { isReleaseVersion }
210+
sign publishing.publications.maven
211+
}
212+
}
213+
214+
tasks.withType(Sign) {
215+
onlyIf { isReleaseVersion }
216+
}
217+
218+
nexusPublishing {
219+
repositories {
220+
sonatype {
221+
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.findProperty('sonatypeOss2Username') ?: ''
222+
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.findProperty("sonatypeOss2Password") ?: ''
223+
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.findProperty("sonatypeOssStagingProfileIdJms") ?: ''
224+
225+
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
226+
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
227+
username = ossUser
228+
password = ossPass
229+
stagingProfileId = ossStagingProfileId
230+
}
231+
}
232+
}
233+
234+
task snapshotVersion {
235+
doLast {
236+
if(!project.version.endsWith('-SNAPSHOT')) {
237+
ant.propertyfile(file: "gradle.properties") {
238+
entry(key: "version", value: "${project.version}-SNAPSHOT")
239+
}
240+
}
241+
}
242+
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version=3.1.0-SNAPSHOT
12
grailsVersion=5.1.1
23
grailsGradlePluginVersion=5.1.0
34
groovyVersion=3.0.7

0 commit comments

Comments
 (0)