Skip to content

Commit

Permalink
Pre release support
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaugherty committed Dec 22, 2024
1 parent e3fd8b5 commit df9666d
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 29 deletions.
1 change: 1 addition & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: build -Dgeb.env=chromeHeadless
- name: Upload Distribution
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
# Otherwise:
- name: Export Gradle Properties
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
uses: micronaut-projects/github-actions/export-gradle-properties@master
- uses: micronaut-projects/github-actions/release-notes@master
uses: grails/github-actions/export-gradle-properties@main
- uses: grails/github-actions/release-notes@main
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
id: release_notes
with:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
id: release_version
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Run pre-release
uses: micronaut-projects/github-actions/pre-release@master
uses: grails/github-actions/pre-release@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Assemble
Expand All @@ -40,6 +40,7 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Distribution
if: success()
uses: actions/upload-artifact@v4
Expand All @@ -64,6 +65,7 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: |
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
Expand All @@ -90,13 +92,14 @@ jobs:
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
NEXUS_PUBLISH_NEXUS_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }}
NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: |
findSonatypeStagingRepository
releaseSonatypeStagingRepository
- name: Run post-release
if: success()
uses: micronaut-projects/github-actions/post-release@master
uses: grails/github-actions/post-release@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
Expand All @@ -119,14 +122,15 @@ jobs:
java-version: '17'
- name: Publish Documentation
id: docs
if: success() || false
if: success()
uses: gradle/gradle-build-action@v3
with:
arguments: docs
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Github Pages
if: steps.docs.outcome == 'success'
uses: grails/github-pages-deploy-action@v2
Expand Down
12 changes: 11 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ apply plugin:"org.grails.grails-publish"
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
if (System.getenv("GITHUB_MAVEN_PASSWORD") && !grailsVersion.endsWith('-SNAPSHOT')) {
System.out.println("Adding Grails Core Repo")
maven {
url = 'https://maven.pkg.github.com/grails/grails-core'
credentials {
username = 'DOES_NOT_MATTER'
password = System.getenv("GITHUB_MAVEN_PASSWORD")
}
}
}
}

dependencies {
Expand Down Expand Up @@ -50,7 +60,7 @@ dependencies {
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.mockito:mockito-core"

integrationTestImplementation testFixtures("org.grails.plugins:geb:5.0.0-SNAPSHOT")
integrationTestImplementation testFixtures("org.grails.plugins:geb")
api "com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:$concurrentlinkedhashmapLruVersion"
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ projectVersion=8.0.0-SNAPSHOT

asciidoctorGradlePlugin=1.6.1
concurrentlinkedhashmapLruVersion=1.4.2
grailsVersion=7.0.0-SNAPSHOT
grailsVersion=7.0.0-M1
grailsDocsVersion=7.0.0-SNAPSHOT
grailsGradlePluginVersion=7.0.0-SNAPSHOT
gormVersion=9.0.0-SNAPSHOT
gparsVersion=1.2.1
groovyVersion=4.0.24
guide=../../guide
Expand Down
41 changes: 20 additions & 21 deletions gradle/docs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ subprojects {
}

def cleanTask = project.tasks.findByName("clean")
if(cleanTask == null) {
if (cleanTask == null) {
task clean(type: Delete) {
delete(buildDir)
}
}
else {
} else {
cleanTask.doLast {
ant.delete(dir:"build/docs")
ant.delete(dir: "build/docs")
}
}

Expand All @@ -92,11 +91,11 @@ tasks.withType(Groovydoc) {
project.rootProject.subprojects
.findAll { !it.name != 'docs' && !it.name.startsWith('examples') }
.each { subproject ->
if(subproject.file('src/main/groovy').exists()) {
if (subproject.file('src/main/groovy').exists()) {
files += subproject.files("src/main/groovy")
}
}
if(project.file('src/main/groovy').exists()) {
if (project.file('src/main/groovy').exists()) {
files += project.files("src/main/groovy")
}
source = files
Expand All @@ -111,26 +110,26 @@ task publishGuide(type: grails.doc.gradle.PublishGuide) {
targetDir = project.file("${buildDir}/docs")
sourceRepo = "https://github.com/${githubSlug}/edit/${githubBranch}/src/main/docs"
sourceDir = new File(projectDir, "src/main/docs")
propertiesFiles = [ new File(rootProject.projectDir, "gradle.properties") ]
propertiesFiles = [new File(rootProject.projectDir, "gradle.properties")]
asciidoc = true
resourcesDir = project.file(docResourcesDir)
properties = [
'safe':'UNSAFE',
'version': project.version,
'subtitle': project.projectDesc,
'api': '../api',
'sourceDir':rootProject.projectDir.absolutePath,
'sourcedir':rootProject.projectDir.absolutePath,
'javaee': 'https://docs.oracle.com/javaee/7/api/',
'javase': 'https://docs.oracle.com/javase/7/docs/api/',
'safe' : 'UNSAFE',
'version' : project.version,
'subtitle' : project.projectDesc,
'api' : '../api',
'sourceDir': rootProject.projectDir.absolutePath,
'sourcedir': rootProject.projectDir.absolutePath,
'jakartaee': "https://jakarta.ee/specifications/platform/10/apidocs/",
'javase' : "https://docs.oracle.com/en/java/javase/17/docs/api/",
'groovyapi': 'http://docs.groovy-lang.org/latest/html/gapi/',
'grailsapi': 'http://docs.grails.org/latest/api/',
'gormapi': 'http://gorm.grails.org/latest/api/',
'gormapi' : 'http://gorm.grails.org/latest/api/',
'springapi': 'https://docs.spring.io/spring/docs/current/javadoc-api/'
]
doLast {
ant.move(file:"${project.buildDir}/docs/guide/single.html",
tofile:"${project.buildDir}/docs/guide/index.html", overwrite:true)
ant.move(file: "${project.buildDir}/docs/guide/single.html",
tofile: "${project.buildDir}/docs/guide/index.html", overwrite: true)
new File(project.buildDir, "docs/index.html").text = '''
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
Expand All @@ -144,13 +143,13 @@ task publishGuide(type: grails.doc.gradle.PublishGuide) {
}
}

task docs(dependsOn:[groovydoc, publishGuide]) {
task docs(dependsOn: [groovydoc, publishGuide]) {
group = DOCUMENTATION_GROUP
}

def assembleTask = project.tasks.findByName("assemble")
if(assembleTask == null) {
task assemble(dependsOn: docs, type:Zip) {
if (assembleTask == null) {
task assemble(dependsOn: docs, type: Zip) {
baseName = "${project.name}-${project.version}"
destinationDir = new File(project.buildDir, "distributions")
from project.files("${buildDir}/docs")
Expand Down

0 comments on commit df9666d

Please sign in to comment.