Skip to content

Commit

Permalink
Updating Build
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaugherty committed Dec 9, 2024
1 parent 710fff4 commit 9f61b78
Show file tree
Hide file tree
Showing 13 changed files with 212 additions and 132 deletions.
55 changes: 31 additions & 24 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,53 @@ jobs:
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
SIGNING_KEYRING: ${{ secrets.SECRING_FILE }}
steps:
- uses: actions/checkout@v4
- name: Setup up node
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
- name: "🧱 Setup up node"
uses: actions/setup-node@v3
with:
node-version: '20.5.1'
- run: npm install
- run: npx gulp grailsRelease
- name: Set up JDK
- name: "Pull node dependencies"
run: npm install
- name: "Package node dependencies"
run: npx gulp grailsRelease
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Run build with Gradle Wrapper
run: ./gradlew build -Dgeb.env=chromeHeadless
working-directory: plugin
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
- name: "🔨 Run Base Tests"
run: ./gradlew check --continue
publish:
if: github.event_name == 'push'
needs: ['build']
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup up node
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
- name: "🧱 Setup up node"
uses: actions/setup-node@v3
with:
node-version: '20.5.1'
- run: npm install
- run: npx gulp grailsRelease
- name: Set up JDK
- name: "Pull node dependencies"
run: npm install
- name: "Package node dependencies"
run: npx gulp grailsRelease
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Publish Artifacts (repo.grails.org)
id: publish
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
- name: "📤 Publish to Snapshot (repo.grails.org)"
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
working-directory: plugin
run: ./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true publish
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
MAVEN_PUBLISH_URL: ${{ secrets.MAVEN_PUBLISH_SNAPSHOT_URL }}
working-directory: ./plugin
run: ../gradlew publish
112 changes: 112 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Release
on:
release:
types: [published]
env:
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: '[email protected]'
jobs:
publish:
permissions:
contents: write # to create release
issues: write # to modify milestones
runs-on: ubuntu-latest
outputs:
release_version: ${{ steps.release_version.outputs.value }}
target_branch: ${{ steps.extract_branch.outputs.value }}
steps:
- name: "📥 Checkout the repository"
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: "🧱 Setup up node"
uses: actions/setup-node@v3
with:
node-version: '20.5.1'
- name: "Pull node dependencies"
run: npm install
- name: "Package node dependencies"
run: npx gulp grailsRelease
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '17'
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
- name: "📝 Store the target branch"
id: extract_branch
run: |
echo "Determining Target Branch"
TARGET_BRANCH=${GITHUB_REF#refs/heads/}
echo $TARGET_BRANCH
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
- name: "📝Set the current release version"
id: release_version
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: "⚙️ Run pre-release"
uses: micronaut-projects/github-actions/pre-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: "🧩 Run Assemble"
if: success()
id: assemble
run: ./gradlew assemble
- name: "🔐 Generate secring file"
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: "🚀 Publish to Sonatype OSSRH"
id: publish
env:
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 }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
working-directory: ./plugin
run: >
../gradlew
-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
- name: "☕️ Setup JDK"
uses: actions/setup-java@v4
with:
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
- name: "🏆Nexus Staging Close And Release"
env:
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 }}
working-directory: ./plugin
run: >
../gradlew
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Java CI](https://github.com/gpc/grails-web-console/actions/workflows/gradle.yml/badge.svg)](https://github.com/gpc/grails-web-console/actions/workflows/gradle.yml)
[![Java CI](https://github.com/grails-plugins/grails-web-console/actions/workflows/gradle.yml/badge.svg)](https://github.com/grails-plugins/grails-web-console/actions/workflows/gradle.yml)

# Grails Web Console

Expand Down Expand Up @@ -27,7 +27,7 @@ repositories {
}
dependencies {
runtimeOnly 'com.github.gpc:grails-web-console:7.0.0-SNAPSHOT'
runtimeOnly 'com.github.grails-plugins:grails-web-console:7.0.0-SNAPSHOT'
}
```

Expand Down Expand Up @@ -74,7 +74,7 @@ The following implicit variables are available:
* `session` - the current [HTTP session](http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpSession.html)
* `out` - the output [PrintStream](http://docs.oracle.com/javase/7/docs/api/java/io/PrintStream.html)

See [Script Examples](https://github.com/gpc/grails-web-console/wiki/Script-Examples) for example usage.
See [Script Examples](https://github.com/grails-plugins/grails-web-console/wiki/Script-Examples) for example usage.

## Keyboard Shortcuts

Expand Down
42 changes: 4 additions & 38 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id "groovy"
id "org.grails.grails-web"
id "org.grails.grails-gsp"
id "com.github.erdi.webdriver-binaries"
id "war"
id "idea"
id "com.bertramlabs.asset-pipeline"
Expand All @@ -12,20 +11,6 @@ plugins {

group = "grails.app"

repositories {
maven { url "https://repo.grails.org/grails/core" }
}

configurations {
all {
resolutionStrategy.eachDependency { DependencyResolveDetails details->
if (details.requested.group == 'org.seleniumhq.selenium') {
details.useVersion('4.19.1')
}
}
}
}

dependencies {
implementation("org.grails:grails-core")
implementation("org.grails:grails-logging")
Expand All @@ -46,22 +31,15 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-tomcat")
implementation("org.springframework.boot:spring-boot-starter-validation")
console("org.grails:grails-console")
runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:5.0.1")
runtimeOnly("com.bertramlabs.plugins:asset-pipeline-grails:${assetPipelineVersion}")
runtimeOnly("com.h2database:h2")
runtimeOnly("org.apache.tomcat:tomcat-jdbc")
runtimeOnly("org.fusesource.jansi:jansi:1.18")
testImplementation("io.micronaut:micronaut-inject-groovy")
testImplementation("org.grails:grails-gorm-testing-support")
testImplementation("org.grails:grails-web-testing-support")
testImplementation("org.grails.plugins:geb")
testImplementation("org.seleniumhq.selenium:selenium-api:4.19.1")
testImplementation("org.seleniumhq.selenium:selenium-remote-driver:4.19.1")
testImplementation("org.seleniumhq.selenium:selenium-support:4.19.1")

integrationTestImplementation testFixtures("org.grails.plugins:geb:${gebVersion}")
testImplementation("org.spockframework:spock-core")
testRuntimeOnly("org.seleniumhq.selenium:selenium-chrome-driver:4.19.1")
testRuntimeOnly("org.seleniumhq.selenium:selenium-firefox-driver:4.19.1")
testRuntimeOnly("org.seleniumhq.selenium:selenium-safari-driver:4.19.1")
testImplementation("io.micronaut:micronaut-http-client")

implementation project(':plugin')

Expand All @@ -71,22 +49,10 @@ application {
mainClass.set("grails.app.Application")
}

java {
sourceCompatibility = JavaVersion.toVersion("17")
}

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

assets {
minifyJs = true
minifyCss = true
Expand Down
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
allprojects {
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
}
}

version project.projectVersion

subprojects { project ->
version project.projectVersion

apply plugin: "groovy"

project.compileJava.options.release = 17
}
12 changes: 0 additions & 12 deletions buildSrc/build.gradle

This file was deleted.

4 changes: 4 additions & 0 deletions app/gradle.properties → gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
projectVersion=7.0.0-SNAPSHOT

grailsVersion=7.0.0-SNAPSHOT
grailsGradlePluginVersion=7.0.0-SNAPSHOT
gebVersion=5.0.0-SNAPSHOT
assetPipelineVersion=5.0.1
version=7.0.0-SNAPSHOT
org.gradle.caching=true
org.gradle.daemon=true
Expand Down
Loading

0 comments on commit 9f61b78

Please sign in to comment.