Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 41 additions & 53 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,67 @@
name: Java CI
name: "Java CI"
on:
push:
branches:
- '[4-9]+.[0-9]+.x'
pull_request:
branches:
- '[4-9]+.[0-9]+.x'
workflow_dispatch:
env:
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}

jobs:

test_project:
name: Test Project
name: "Test Project"
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
java: [11, 17]

steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
- uses: gradle/actions/setup-gradle@v3
- name: Run tests
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
distribution: liberica
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "🏃 Run tests"
run: ./gradlew check

publish_snapshot:
name: Build Project and Publish Snapshot release
runs-on: ubuntu-latest
if: github.event_name == 'push'

if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.repository_owner == 'grails-plugins'
name: "Build Project and Publish Snapshot release"
needs: test_project
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with: { java-version: 11, distribution: temurin }
- uses: gradle/actions/setup-gradle@v3

- name: Build Project
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
run: ./gradlew build

- name: Publish Snapshot version to Artifactory (repo.grails.org)
if: success()
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
ORG_GRADLE_PROJECT_artifactoryPublishUsername: ${{ secrets.ARTIFACTORY_USERNAME }}
ORG_GRADLE_PROJECT_artifactoryPublishPassword: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: >
./gradlew
-Dorg.gradle.internal.publish.checksums.insecure=true
publish

- name: Generate Snapshot Documentation
if: success()
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
java-version: 11
distribution: liberica
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "📤 Publish Snapshot version to Artifactory (repo.grails.org)"
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
GRAILS_PUBLISH_RELEASE: 'false'
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
MAVEN_PUBLISH_URL: 'https://repo.grails.org/artifactory/plugins3-snapshots-local'
run: ./gradlew publish
- name: "📖 Generate Snapshot Documentation"
run: ./gradlew docs

- name: Publish Snapshot Documentation to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@grails
- name: "📤 Publish Snapshot Documentation to Github Pages"
uses: apache/grails-github-actions/deploy-github-pages@asf
env:
BRANCH: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
FOLDER: build/docs/manual
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GRADLE_PUBLISH_RELEASE: 'false'
SOURCE_FOLDER: build/docs
83 changes: 39 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,61 @@
name: Release
name: "Release"
on:
release:
types: [published]
env:
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}

jobs:
release:
runs-on: ubuntu-latest

runs-on: ubuntu-24.04
permissions:
packages: read # for pre-release workflow
contents: write # to commit changes related to the release and publish documentation to gh-pages
issues: write # to modify milestones
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with: { java-version: 11, distribution: temurin }
- uses: gradle/actions/setup-gradle@v3

- name: Get the current release version
id: release_version
run: echo "release_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT

- name: Run pre-release
uses: micronaut-projects/github-actions/pre-release@master

- name: Generate secring file
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
java-version: 11
distribution: liberica
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "📝 Store the current release version"
run: |
echo "Release version: ${GITHUB_REF:11}"
echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
- name: "⚙️ Run pre-release"
uses: apache/grails-github-actions/pre-release@asf
- name: "🔐 Generate key file for artifact signing"
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg

- name: Publish artifacts to Sonatype
id: publish_to_sonatype
- name: "📤 Publish artifacts to Sonatype"
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
GRAILS_PUBLISH_RELEASE: 'true'
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }}
NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
run: >
./gradlew
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeAndReleaseSonatypeStagingRepository

- name: Generate Documentation
if: success()
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "📖 Generate Documentation"
run: ./gradlew docs

- name: Publish Documentation to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@grails
- name: "📤 Publish Documentation to Github Pages"
uses: apache/grails-github-actions/deploy-github-pages@asf
env:
BRANCH: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
FOLDER: build/docs/manual
GH_TOKEN: ${{ secrets.GH_TOKEN }}
VERSION: ${{ steps.release_version.outputs.release_version }}

- name: Run post-release
if: steps.publish_to_sonatype.outcome == 'success'
uses: micronaut-projects/github-actions/post-release@master
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GRADLE_PUBLISH_RELEASE: 'true'
SOURCE_FOLDER: build/docs
VERSION: ${{ env.RELEASE_VERSION }}
- name: "⚙️ Run post-release"
uses: apache/grails-github-actions/post-release@asf
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Grails Mail Plugin

[![Maven Central](https://img.shields.io/maven-central/v/org.grails.plugins/mail.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/org.grails.plugins/mail)
[![Java CI](https://github.com/grails/grails-mail/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/grails/grails-mail/actions/workflows/gradle.yml)
[![Java CI](https://github.com/grails-plugins/grails-mail/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/grails-plugins/grails-mail/actions/workflows/gradle.yml)

## About

Expand All @@ -21,7 +21,7 @@ mailService.sendMail {

## Documentation

[Latest documentation](https://grails.github.io/grails-mail/latest/) and [snapshots](https://grails.github.io/grails-mail/snapshot/) are available.
[Latest documentation](https://grails-plugins.github.io/grails-mail/latest/) and [snapshots](https://grails-plugins.github.io/grails-mail/snapshot/) are available.

## Versions

Expand All @@ -34,7 +34,7 @@ mailService.sendMail {

## Issues

Issues can be raised via [GitHub Issues](https://github.com/grails/grails-mail/issues).
Issues can be raised via [GitHub Issues](https://github.com/grails-plugins/grails-mail/issues).

## Contributing

Expand Down
13 changes: 8 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {

version = projectVersion
group = 'org.grails.plugins'

ext.set('grailsVersion', libs.versions.grails.asProvider().get())
ext.set('isReleaseVersion', !version.toString().endsWith('-SNAPSHOT'))
ext.set('isSnapshot', !isReleaseVersion)
Expand Down Expand Up @@ -58,11 +59,13 @@ dependencies {
tasks.withType(Test).configureEach {
useJUnitPlatform()
testLogging {
events 'passed', 'skipped', 'failed'
events('passed', 'skipped', 'failed')
}
}

apply from: layout.projectDirectory.file('gradle/java-config.gradle')
apply from: layout.projectDirectory.file('gradle/grails-plugin-config.gradle')
apply from: layout.projectDirectory.file('gradle/documentation-config.gradle')
apply from: layout.projectDirectory.file('gradle/publishing.gradle')
apply {
from layout.projectDirectory.file('gradle/java-config.gradle')
from layout.projectDirectory.file('gradle/grails-plugin-config.gradle')
from layout.projectDirectory.file('gradle/documentation-config.gradle')
from layout.projectDirectory.file('gradle/publishing.gradle')
}
4 changes: 2 additions & 2 deletions gradle/buildsrc.libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
grails-gradle-plugin = '6.2.0'
nexus-publish-gradle-plugin = '1.3.0'
grails-gradle-plugin = '6.2.4'
nexus-publish-gradle-plugin = '2.0.0'

[libraries]
grails-gradle-plugin = { module = 'org.grails:grails-gradle-plugin', version.ref = 'grails-gradle-plugin' }
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]
grails = '6.2.0'
grails-testing-support = '3.2.1'
grails = '6.2.3'
grails-testing-support = '3.2.2'
greenmail = '1.6.15'
groovy = '3.0.21'
groovy = '3.0.25'
gsp = '6.2.1'
javamail = '1.6.2'
slf4j = '1.7.36'
spring = '5.3.34'
spring = '5.3.39'
springboot = '2.7.18'
spock = '2.3-groovy-3.0'

Expand Down
29 changes: 11 additions & 18 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ publishing {
publications {
register('grailsMailPlugin', MavenPublication) {
from javaComponent.get()
versionMapping {
usage('java-api') { fromResolutionOf('runtimeClasspath') }
usage('java-runtime') { fromResolutionResult() }
}
pom {
name = 'Grails Mail plugin'
description = 'Provides Mail support to a running Grails application'
url = 'https://github.com/grails/grails-mail'
url = 'https://github.com/grails-plugins/grails-mail'
licenses {
license {
name = 'The Apache License, Version 2.0'
Expand Down Expand Up @@ -65,9 +61,9 @@ publishing {
}
}
scm {
connection = 'scm:git:git://github.com/grails/grails-mail.git'
developerConnection = 'scm:git:ssh://github.com:grails/grails-mail.git'
url = 'https://github.com/grails/grails-mail'
connection = 'scm:git:git://github.com/grails-plugins/grails-mail.git'
developerConnection = 'scm:git:ssh://github.com:grails-plugins/grails-mail.git'
url = 'https://github.com/grails-plugins/grails-mail'
}
}
// dependency management shouldn't be included
Expand All @@ -82,10 +78,10 @@ publishing {
repositories {
maven {
credentials {
username = findProperty('artifactoryPublishUsername') ?: ''
password = findProperty('artifactoryPublishPassword') ?: ''
username = System.getenv('MAVEN_PUBLISH_USERNAME')
password = System.getenv('MAVEN_PUBLISH_PASSWORD')
}
url = uri('https://repo.grails.org/grails/plugins3-snapshots-local')
url = uri(System.getenv('MAVEN_PUBLISH_URL') ?: '')
}
}
}
Expand All @@ -104,15 +100,12 @@ afterEvaluate {

if (isReleaseVersion) {
nexusPublishing {
String sonatypeUsername = findProperty('sonatypeUsername') ?: ''
String sonatypePassword = findProperty('sonatypePassword') ?: ''
String sonatypeStagingProfileId = findProperty('sonatypeStagingProfileId') ?: ''
repositories {
sonatype {
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
username = sonatypeUsername
password = sonatypePassword
stagingProfileId = sonatypeStagingProfileId
nexusUrl = uri(System.getenv('NEXUS_PUBLISH_URL') ?: '')
username = System.getenv('NEXUS_PUBLISH_USERNAME')
password = System.getenv('NEXUS_PUBLISH_PASSWORD')
stagingProfileId = System.getenv('NEXUS_PUBLISH_STAGING_PROFILE_ID')
}
}
}
Expand Down
Loading
Loading