Skip to content

Commit

Permalink
Merge pull request #4 from vsachinv/3.3x_publish_2.0.3
Browse files Browse the repository at this point in the history
Update build version as 2.0.3 and also update readme.md.
  • Loading branch information
matrei committed Sep 15, 2023
2 parents b2fec3b + 52aeb95 commit c606a4a
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 16 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle

name: Gradle Package

on:
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build

# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to GitHub Packages
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: publish
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ Links
Installation
------------

To install just add the plugin to the plugins block of `build.gradle`. For Grails 3.3.x
To install just add the plugin to the plugins block of `build.gradle`.

For Grails 3.3.x (Via jitpack proxy on github registry packages as for grails 3.3.x support on nexus publish not working)

```groovy
repositories {
maven { url 'https://jitpack.io' }
}
```

```groovy
compile "org.grails.plugins:asynchronous-mail:2.0.2"
compile "com.github.gpc:asynchronous-mail:2.0.3" // or compile "org.grails.plugins:asynchronous-mail:2.0.2"
```

For Grails 3.2.11 and earlier
Expand Down
107 changes: 93 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ buildscript {
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2"
classpath "com.gorylenko.gradle-git-properties:com.gorylenko.gradle-git-properties.gradle.plugin:1.5.2"
}
}

version "2.0.2"
version "2.0.3"
group "org.grails.plugins"

sourceCompatibility = 1.8

apply plugin: 'idea'
apply plugin:"org.grails.grails-plugin"
apply plugin:"org.grails.grails-plugin-publish"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
apply plugin: "com.gorylenko.gradle-git-properties"
apply plugin: 'maven-publish'

ext {
grailsVersion = project.grailsVersion
Expand Down Expand Up @@ -60,6 +65,44 @@ task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}

task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

task packageJavadoc(type: Jar) {
from javadoc
classifier = 'javadoc'
}

task packageGroovydoc(type: Jar) {
from groovydoc
classifier = 'groovydoc'
}


gitProperties {
keys = ['git.branch', 'git.commit.id', 'git.commit.time', 'git.commit.id.abbrev']
failOnNoGitDirectory = true
extProperty = 'gitProps' // git properties will be put in a map at project.ext.gitProps
}

generateGitProperties.outputs.upToDateWhen { false } // make sure the generateGitProperties task always executes (even when git.properties is not changed)

jar {
dependsOn generateGitProperties
manifest {
attributes("Built-By": System.getProperty("user.name"))
attributes(["Plugin-Version" : version,
"Plugin-Title" : project.name,
"Plugin-Build-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Git-Commit" : "${-> project.ext.gitProps['git.commit.id.abbrev']}",
"Git-Branch" : "${-> project.ext.gitProps['git.branch']}"])
}
from sourceSets.main.output
exclude 'git.properties'
}

grailsPublish {
userOrg = 'kefirsf'
license {
Expand All @@ -71,18 +114,54 @@ grailsPublish {
title = "Grails Asynchronous Mail plugin"
desc = "The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job."
developers = [
kefirfromperm:"Vitalii Samolovskikh",
stokito:"Sergey Ponomarev",
ilopmar:"Iván López",
burtbeckwith:"Burt Beckwith",
puneetbehl:"Puneet Behl",
aberbenni:"Alessandro Berbenni",
dpcasady:"Danny Casady",
SAgrawal14:"Shashank Agrawal",
visheshd:"Vishesh",
'micke-a':"Mikael Andersson",
pgdoval:"Pablo González Doval",
Uniqen:"Magnus Dalin",
demon101:"Demon"
kefirfromperm: "Vitalii Samolovskikh",
stokito : "Sergey Ponomarev",
ilopmar : "Iván López",
burtbeckwith : "Burt Beckwith",
puneetbehl : "Puneet Behl",
aberbenni : "Alessandro Berbenni",
dpcasady : "Danny Casady",
SAgrawal14 : "Shashank Agrawal",
visheshd : "Vishesh",
'micke-a' : "Mikael Andersson",
pgdoval : "Pablo González Doval",
Uniqen : "Magnus Dalin",
demon101 : "Demon",
vsachinv : "Sachin Verma"
]
}


javadoc {
source = sourceSets.main.allJava
classpath = configurations.compileClasspath
options
{
setMemberLevel JavadocMemberLevel.PUBLIC
setAuthor true

links "https://docs.oracle.com/javase/8/docs/api/"
}
}


publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/gpc/grails-asynchronous-mail"
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from components.java
artifact sourceJar
artifact packageJavadoc
artifact packageGroovydoc
}
}
}

0 comments on commit c606a4a

Please sign in to comment.