Skip to content

Commit

Permalink
Merge pull request #48 from jdaugherty/5.0.x
Browse files Browse the repository at this point in the history
Grails 7 - build cleanup related to grails-publish update
  • Loading branch information
jdaugherty authored Dec 3, 2024
2 parents 8722ce0 + 30df7de commit 4b706e4
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 253 deletions.
95 changes: 69 additions & 26 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,89 @@ jobs:
build:
runs-on: ubuntu-latest
env:
WORKSPACE: ${{ github.workspace }}
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- name: Set up JDK
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: 'temurin'
distribution: liberica
java-version: 17
- name: Run Tests
if: github.event_name == 'pull_request'
id: tests
uses: gradle/gradle-build-action@v2
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
arguments: check -Dgeb.env=chromeHeadless
- name: Run Build
if: github.event_name == 'push'
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: "🔨 Build project"
id: build
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: build -Dgeb.env=chromeHeadless
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
run:
./gradlew build
- name: Publish Test Report
if: steps.build.outcome == 'failure' || steps.tests.outcome == 'failure'
if: steps.build.outcome == 'failure'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Publish to repo.grails.org
publish:
if: github.event_name == 'push'
needs: [ 'build' ]
runs-on: ubuntu-latest
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: "📤 Publish Snapshot Artifacts"
id: publish
uses: gradle/gradle-build-action@v2
if: steps.build.outcome == 'success' && github.event_name == 'push'
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
run: ./gradlew publish
docs:
if: github.event_name == 'push'
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
env:
GIT_USER_NAME: grails-build
GIT_USER_EMAIL: grails-build@users.noreply.github.com
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
- name: Build Documentation
id: docs
uses: gradle/gradle-build-action@v2
distribution: liberica
java-version: 17
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
arguments: docs:docs
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: "📜 Build Documentation"
run: ./gradlew docs:docs
- name: "🚀 Publish to Github Pages"
id: docs
if: success()
uses: grails/github-pages-deploy-action@v2
env:
SKIP_SNAPSHOT: ${{ contains(needs.publish.outputs.release_version, 'M') }}
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/docs
DOC_FOLDER: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
75 changes: 42 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,22 @@ jobs:
release_version: ${{ steps.release_version.outputs.value }}
runs-on: ubuntu-latest
env:
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: behlp@unityfoundation.io
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: 'grails-build@users.noreply.github.com'
steps:
- name: Checkout repository
- name: "📥 Checkout repository"
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Set up JDK
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
distribution: liberica
java-version: 17
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Set the current release version
id: release_version
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
Expand All @@ -30,9 +34,7 @@ jobs:
- name: Run Assemble
if: success()
id: assemble
uses: gradle/gradle-build-action@v2
with:
arguments: assemble
run: ./gradlew assemble
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Upload Distribution
Expand All @@ -47,18 +49,17 @@ jobs:
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: Publish to Sonatype OSSRH
id: publish
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
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 }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
with:
arguments: |
run: >
./gradlew
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeSonatypeStagingRepository
Expand All @@ -68,26 +69,32 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK
- name: "📥 Checkout repository"
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
distribution: liberica
java-version: 17
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Nexus Staging Close And Release
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
with:
arguments: |
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
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 }}
run: >
findSonatypeStagingRepository
releaseSonatypeStagingRepository
- name: Run post-release
Expand All @@ -106,18 +113,20 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
distribution: 'liberica'
java-version: '17'
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Build Documentation
id: docs
uses: gradle/gradle-build-action@v2
with:
arguments: docs:docs
run: ./gradlew docs:docs
- name: Publish to Github Pages
if: success()
uses: grails/github-pages-deploy-action@v2
Expand All @@ -126,8 +135,8 @@ jobs:
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
FOLDER: docs/build/docs
DOC_FOLDER: gh-pages
COMMIT_EMAIL: behlp@unityfoundation.io
COMMIT_NAME: Puneet Behl
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
VERSION: ${{ needs.publish.outputs.release_version }}
26 changes: 11 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
plugins {
id 'groovy'
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
}
}

subprojects {
configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.seleniumhq.selenium') {
details.useVersion(seleniumVersion)
}
}
}
plugins {
id 'groovy'
}

compileJava.options.release = 17
3 changes: 0 additions & 3 deletions docs/src/docs/code/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ dependencies {
profile "org.grails.profiles:web"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.1"
runtime "com.h2database:h2"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
compile "org.grails.plugins:spring-security-acl:${file('../../../version.txt').text.trim()}"
}

Expand Down
17 changes: 0 additions & 17 deletions functional-test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ buildscript {
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:$gormVersion"
classpath "com.github.erdi:webdriver-binaries-gradle-plugin:3.2"
}
}

Expand All @@ -17,7 +15,6 @@ apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"com.github.erdi.webdriver-binaries"
apply plugin:"org.grails.grails-gsp"

repositories {
Expand Down Expand Up @@ -52,25 +49,11 @@ dependencies {
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
integrationTestImplementation testFixtures('org.grails.plugins:geb')

testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
implementation project(':spring-security-acl')
}

tasks.withType(Test) {
useJUnitPlatform()
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (System.getenv('CHROMEWEBDRIVER')) {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
}
if (System.getenv('GECKOWEBDRIVER')) {
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}

beforeTest { descriptor -> logger.quiet " -- $descriptor" }
testLogging {
Expand Down

This file was deleted.

Loading

0 comments on commit 4b706e4

Please sign in to comment.