Skip to content

Commit c606a4a

Browse files
authored
Merge pull request #4 from vsachinv/3.3x_publish_2.0.3
Update build version as 2.0.3 and also update readme.md.
2 parents b2fec3b + 52aeb95 commit c606a4a

File tree

3 files changed

+148
-16
lines changed

3 files changed

+148
-16
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7+
8+
name: Gradle Package
9+
10+
on:
11+
release:
12+
types: [created]
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up JDK 8
25+
uses: actions/setup-java@v3
26+
with:
27+
java-version: '8'
28+
distribution: 'zulu'
29+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
30+
settings-path: ${{ github.workspace }} # location for the settings.xml file
31+
32+
- name: Build with Gradle
33+
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
34+
with:
35+
arguments: build
36+
37+
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
38+
# the publishing section of your build.gradle
39+
- name: Publish to GitHub Packages
40+
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
41+
with:
42+
arguments: publish
43+
env:
44+
GITHUB_USERNAME: ${{ github.actor }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,18 @@ Links
2525
Installation
2626
------------
2727

28-
To install just add the plugin to the plugins block of `build.gradle`. For Grails 3.3.x
28+
To install just add the plugin to the plugins block of `build.gradle`.
29+
30+
For Grails 3.3.x (Via jitpack proxy on github registry packages as for grails 3.3.x support on nexus publish not working)
31+
32+
```groovy
33+
repositories {
34+
maven { url 'https://jitpack.io' }
35+
}
36+
```
2937

3038
```groovy
31-
compile "org.grails.plugins:asynchronous-mail:2.0.2"
39+
compile "com.github.gpc:asynchronous-mail:2.0.3" // or compile "org.grails.plugins:asynchronous-mail:2.0.2"
3240
```
3341

3442
For Grails 3.2.11 and earlier

build.gradle

Lines changed: 93 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ buildscript {
66
dependencies {
77
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
88
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2"
9+
classpath "com.gorylenko.gradle-git-properties:com.gorylenko.gradle-git-properties.gradle.plugin:1.5.2"
910
}
1011
}
1112

12-
version "2.0.2"
13+
version "2.0.3"
1314
group "org.grails.plugins"
1415

16+
sourceCompatibility = 1.8
17+
1518
apply plugin: 'idea'
1619
apply plugin:"org.grails.grails-plugin"
1720
apply plugin:"org.grails.grails-plugin-publish"
1821
apply plugin:"org.grails.grails-gsp"
1922
apply plugin:"asset-pipeline"
23+
apply plugin: "com.gorylenko.gradle-git-properties"
24+
apply plugin: 'maven-publish'
2025

2126
ext {
2227
grailsVersion = project.grailsVersion
@@ -60,6 +65,44 @@ task wrapper(type: Wrapper) {
6065
gradleVersion = gradleWrapperVersion
6166
}
6267

68+
task sourceJar(type: Jar) {
69+
classifier = 'sources'
70+
from sourceSets.main.allSource
71+
}
72+
73+
task packageJavadoc(type: Jar) {
74+
from javadoc
75+
classifier = 'javadoc'
76+
}
77+
78+
task packageGroovydoc(type: Jar) {
79+
from groovydoc
80+
classifier = 'groovydoc'
81+
}
82+
83+
84+
gitProperties {
85+
keys = ['git.branch', 'git.commit.id', 'git.commit.time', 'git.commit.id.abbrev']
86+
failOnNoGitDirectory = true
87+
extProperty = 'gitProps' // git properties will be put in a map at project.ext.gitProps
88+
}
89+
90+
generateGitProperties.outputs.upToDateWhen { false } // make sure the generateGitProperties task always executes (even when git.properties is not changed)
91+
92+
jar {
93+
dependsOn generateGitProperties
94+
manifest {
95+
attributes("Built-By": System.getProperty("user.name"))
96+
attributes(["Plugin-Version" : version,
97+
"Plugin-Title" : project.name,
98+
"Plugin-Build-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
99+
"Git-Commit" : "${-> project.ext.gitProps['git.commit.id.abbrev']}",
100+
"Git-Branch" : "${-> project.ext.gitProps['git.branch']}"])
101+
}
102+
from sourceSets.main.output
103+
exclude 'git.properties'
104+
}
105+
63106
grailsPublish {
64107
userOrg = 'kefirsf'
65108
license {
@@ -71,18 +114,54 @@ grailsPublish {
71114
title = "Grails Asynchronous Mail plugin"
72115
desc = "The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job."
73116
developers = [
74-
kefirfromperm:"Vitalii Samolovskikh",
75-
stokito:"Sergey Ponomarev",
76-
ilopmar:"Iván López",
77-
burtbeckwith:"Burt Beckwith",
78-
puneetbehl:"Puneet Behl",
79-
aberbenni:"Alessandro Berbenni",
80-
dpcasady:"Danny Casady",
81-
SAgrawal14:"Shashank Agrawal",
82-
visheshd:"Vishesh",
83-
'micke-a':"Mikael Andersson",
84-
pgdoval:"Pablo González Doval",
85-
Uniqen:"Magnus Dalin",
86-
demon101:"Demon"
117+
kefirfromperm: "Vitalii Samolovskikh",
118+
stokito : "Sergey Ponomarev",
119+
ilopmar : "Iván López",
120+
burtbeckwith : "Burt Beckwith",
121+
puneetbehl : "Puneet Behl",
122+
aberbenni : "Alessandro Berbenni",
123+
dpcasady : "Danny Casady",
124+
SAgrawal14 : "Shashank Agrawal",
125+
visheshd : "Vishesh",
126+
'micke-a' : "Mikael Andersson",
127+
pgdoval : "Pablo González Doval",
128+
Uniqen : "Magnus Dalin",
129+
demon101 : "Demon",
130+
vsachinv : "Sachin Verma"
87131
]
88132
}
133+
134+
135+
javadoc {
136+
source = sourceSets.main.allJava
137+
classpath = configurations.compileClasspath
138+
options
139+
{
140+
setMemberLevel JavadocMemberLevel.PUBLIC
141+
setAuthor true
142+
143+
links "https://docs.oracle.com/javase/8/docs/api/"
144+
}
145+
}
146+
147+
148+
publishing {
149+
repositories {
150+
maven {
151+
name = "GitHubPackages"
152+
url = "https://maven.pkg.github.com/gpc/grails-asynchronous-mail"
153+
credentials {
154+
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
155+
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
156+
}
157+
}
158+
}
159+
publications {
160+
gpr(MavenPublication) {
161+
from components.java
162+
artifact sourceJar
163+
artifact packageJavadoc
164+
artifact packageGroovydoc
165+
}
166+
}
167+
}

0 commit comments

Comments
 (0)