Skip to content

Commit

Permalink
Merge pull request #559 from jdaugherty/feature/mergeTo6
Browse files Browse the repository at this point in the history
Merge 5.0.x to 6.0.x
  • Loading branch information
jdaugherty authored Nov 6, 2024
2 parents 7643af6 + acccb6b commit 0eee695
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 41 deletions.
90 changes: 72 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,99 @@ env:
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: '[email protected]'
jobs:
release:
publish:
outputs:
release_version: ${{ steps.release_version.outputs.value }}
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Wrapper Integrity
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java
- name: Set up JDK
uses: actions/setup-java@v4
with: { java-version: 17, distribution: temurin }
- name: Get the current release version
id: Set the current release version
run: echo "release_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Set the current release version
id: release_version
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Tag the release version
uses: micronaut-projects/github-actions/pre-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate secring file
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: Publish to Sonatype
id: publish_to_sonatype
uses: gradle/actions/setup-gradle@v3
- name: Publish to Sonatype OSSRH
id: publish
uses: gradle/gradle-build-action@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_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 }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: |
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeAndReleaseSonatypeStagingRepository
- name: Generate Documentation
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeSonatypeStagingRepository
release:
needs: publish
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: Wrapper Integrity
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK
uses: actions/setup-java@v4
with: { java-version: 17, distribution: temurin }
- name: Nexus Staging Close And Release
uses: gradle/gradle-build-action@v3
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: |
findSonatypeStagingRepository
releaseSonatypeStagingRepository
- name: Run post-release
if: success()
uses: micronaut-projects/github-actions/post-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
SNAPSHOT_SUFFIX: -SNAPSHOT
docs:
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: Wrapper Integrity
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK
uses: actions/setup-java@v4
with: { java-version: 17, distribution: temurin }
- name: Generate Documentation
id: docs
uses: gradle/actions/setup-gradle@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
Expand All @@ -57,7 +114,4 @@ jobs:
FOLDER: build/docs
GH_TOKEN: ${{ secrets.GH_TOKEN }}
SKIP_SNAPSHOT: ${{ contains(steps.release_version.outputs.release_version, 'M') }}
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
VERSION: ${{ needs.publish.outputs.release_version }}
32 changes: 25 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "io.github.gradle-nexus:publish-plugin:$gradlePublishPlugin"
classpath 'com.adarshr:gradle-test-logger-plugin:4.0.0'
classpath 'io.spring.gradle:dependency-management-plugin'
}
}

Expand All @@ -27,17 +28,33 @@ def profileProjects = ['spring-security-rest-testapp-profile']
def publishedProjects = pluginProjects + profileProjects

version projectVersion
group "org.grails.plugins"

ext.set('isSnapshot', projectVersion.endsWith('-SNAPSHOT'))
ext.set('isReleaseVersion', !isSnapshot)

if (isReleaseVersion) {
nexusPublishing {
String nexusUser = findProperty('sonatypeUsername')
String nexusPass = findProperty('sonatypePassword')
String nexusStagingProfileId = findProperty('sonatypeStagingProfileId')
repositories {
sonatype {
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
username = nexusUser
password = nexusPass
stagingProfileId = nexusStagingProfileId
}
}
}
}

subprojects { Project project ->
group projectGroup
group "org.grails.plugins"
version projectVersion

ext {
grailsVersion = project.grailsVersion
isSnapshot = version.endsWith('SNAPSHOT')
isReleaseVersion = !ext.isSnapshot
isProfile = project.name.endsWith('-profile')
}
ext.set('grailsVersion', project.grailsVersion)
ext.set('isProfile', project.name.endsWith('-profile'))

repositories {
mavenCentral()
Expand Down Expand Up @@ -90,6 +107,7 @@ subprojects { Project project ->

if (project.name in profileProjects) {
apply plugin: "org.grails.grails-profile"
apply plugin: "io.spring.dependency-management"
}

if (project.name in publishedProjects) {
Expand Down
11 changes: 2 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
projectGroup=org.grails.plugins
projectVersion=6.0.0-SNAPSHOT
grailsVersion=7.0.0-SNAPSHOT
grailsGradlePluginVersion=7.0.0-SNAPSHOT
gradlePublishPlugin=1.3.0
gradlePublishPlugin=2.0.0
springSecurityCoreVersion=7.0.0-SNAPSHOT
pac4jVersion=6.0.6
jackson.version=2.18.0

# Publish Information
title=Spring Security REST plugin
projectDesc=Grails plugin to implement token-based, RESTful authentication using Spring Security
projectUrl=https://github.com/grails/grails-spring-security-rest
githubSlug=grails/grails-spring-security-rest
jackson.version=2.18.0
12 changes: 6 additions & 6 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ ext.set('signing.keyId', project.findProperty('signing.keyId') ?: System.getenv(
ext.set('signing.password', project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE'))

def pomInfo = {
delegate.name project.title
delegate.description project.projectDesc
delegate.url projectUrl
delegate.name "Spring Security REST plugin"
delegate.description "Grails plugin to implement token-based, RESTful authentication using Spring Security"
delegate.url "https://github.com/grails/grails-spring-security-rest"

delegate.licenses {
delegate.license {
Expand All @@ -18,9 +18,9 @@ def pomInfo = {
}

delegate.scm {
delegate.url "scm:[email protected]:${githubSlug}.git"
delegate.connection "scm:[email protected]:${githubSlug}.git"
delegate.developerConnection "scm:[email protected]:${githubSlug}.git"
delegate.url "scm:[email protected]:grails/grails-spring-security-rest.git"
delegate.connection "scm:[email protected]:grails/grails-spring-security-rest.git"
delegate.developerConnection "scm:[email protected]:grails/grails-spring-security-rest.git"
}

delegate.developers {
Expand Down
4 changes: 3 additions & 1 deletion spring-security-rest-testapp-profile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ tasks.register('generateProfileConfig') {
expand pluginVersion: project.version
}
}
}
}

compileProfile.dependsOn generateProfileConfig

0 comments on commit 0eee695

Please sign in to comment.