Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub Workflows #137

Merged
merged 4 commits into from
Mar 14, 2022
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
23 changes: 13 additions & 10 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ on:
pull_request:
branches:
- '[4-9]+.[0-9]+.x'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['8']
env:
WORKSPACE: ${{ github.workspace }}
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
Expand All @@ -20,20 +18,25 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
java-version: 8
- name: Run Tests
if: github.event_name == 'pull_request'
id: tests
uses: gradle/gradle-build-action@v2
with:
arguments: check -Dgeb.env=chromeHeadless
env:
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 }}
- name: Run Build
if: github.event_name == 'push'
id: build
uses: gradle/gradle-build-action@v2
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 }}
with:
arguments: build -Dgeb.env=chromeHeadless
- name: Publish Test Report
Expand All @@ -45,26 +48,26 @@ jobs:
- name: Publish to repo.grails.org
id: publish
uses: gradle/gradle-build-action@v2
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
if: steps.build.outcome == 'success' && github.event_name == 'push'
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
- name: Build Docs
id: docs
if: steps.build.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
if: steps.build.outcome == 'success' && github.event_name == 'push'
uses: gradle/gradle-build-action@v2
with:
arguments: docs
arguments: docs:docs
- name: Publish to Github Pages
if: steps.docs.outcome == 'success' && github.event_name == 'push' && matrix.java == '8'
if: steps.docs.outcome == 'success' && github.event_name == 'push'
uses: micronaut-projects/github-pages-deploy-action@master
env:
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
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@objectcomputing.com
COMMIT_NAME: Puneet Behl
10 changes: 8 additions & 2 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- '[4-9]+.[0-9]+.x'
workflow_dispatch:
jobs:
release_notes:
runs-on: ubuntu-latest
Expand All @@ -15,12 +16,17 @@ jobs:
run: |
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
echo ::set-output name=has_release_drafter::${has_release_drafter}

- name: Extract branch name
id: extract_branch
run: echo ::set-output name=value::${GITHUB_REF:11}
# If it has release drafter:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v5.19.0
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
commitish: ${{ steps.extract_branch.outputs.value }}
filter-by-commitish: true
# Otherwise:
- name: Export Gradle Properties
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
Expand Down
45 changes: 23 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,46 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Set the current release version
id: release_version
run: echo ::set-output name=release_version::${GITHUB_REF:11}
- name: Run pre-release
uses: micronaut-projects/github-actions/pre-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish, Upload to Bintray
- 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
uses: gradle/gradle-build-action@v2
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
run: |
echo "Publishing Artifacts"
./gradlew bintrayUpload
echo "Publishing Documentation"
./gradlew docs
SECRING_FILE: ${{ secrets.SECRING_FILE }}
with:
arguments: -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Publish Documentation
id: docs
if: steps.publish.outcome == 'success'
uses: gradle/gradle-build-action@v2
with:
arguments: docs:docs
- name: Export Gradle Properties
uses: micronaut-projects/github-actions/export-gradle-properties@master
- name: Determine docs target repository
if: success()
uses: haya14busa/action-cond@v1
id: docs_target
with:
cond: ${{ github.repository == 'grails-plugins/grails-cache' }}
if_true: "grails-plugins/grails-cache"
if_false: ${{ github.repository }}
- name: Publish to Github Pages
if: success()
if: steps.docs.outcome == 'success'
uses: micronaut-projects/github-pages-deploy-action@master
env:
BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }}
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
Expand All @@ -67,7 +68,7 @@ jobs:
COMMIT_NAME: Puneet Behl
VERSION: ${{ steps.release_version.outputs.release_version }}
- name: Run post-release
if: success()
if: steps.publish.outcome == 'success' && steps.docs.outcome == 'success' && success()
uses: micronaut-projects/github-actions/post-release@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1'
classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion"
}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
projectVersion=5.0.1-SNAPSHOT
grailsVersion=4.0.13
grailsGradlePluginVersion=4.0.13
gormVersion=7.0.8
gradleWrapperVersion=3.5
githubSlug=grails-plugins/grails-cache
Expand Down