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

chore: update GitHub actions workflows #1806

Open
wants to merge 1 commit into
base: 8.1.x
Choose a base branch
from
Open
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
32 changes: 21 additions & 11 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,54 @@ jobs:
matrix:
java: ['11', '14']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
# Publish a Gradle build scan so you can see all the build logs,
# a complete task timeline, test outputs, and the resolved dependencies of your build.
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Run Build
id: build
uses: gradle/gradle-build-action@v2
run: ./gradlew build
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gradle/actions/setup-gradle action replaces gradle/gradle-build-action.
Reference:
https://github.com/gradle/actions/tree/af6e5767241073b8ab20cc8cf7e95ec63fadc160/setup-gradle#the-setup-gradle-action

env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: build
publish:
if: github.event_name == 'push'
needs: ["build"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Publish to Artifactory (repo.grails.org)
uses: gradle/gradle-build-action@v2
run: ./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true publish
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
trigger-build-gorm-impls:
if: github.event_name == 'push'
needs: ["build", "publish"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Extract branch name
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/groovy-joint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
distribution: 'adopt'
java-version: '11.0.6'
- name: Cache local Maven repository & Groovy
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/groovy
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
distribution: 'adopt'
java-version: '11'
- name: Cache local Maven repository & Groovy
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/groovy
Expand All @@ -131,12 +131,18 @@ jobs:
- name: Set CI_GROOVY_VERSION for Grails
run: |
echo "CI_GROOVY_VERSION=${{needs.build_groovy.outputs.groovyVersion}}" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
# Publish a Gradle build scan so you can see all the build logs,
# a complete task timeline, test outputs, and the resolved dependencies of your build.
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Build GORM
id: build_gorm
uses: gradle/gradle-build-action@v2
run: >
./gradlew build
-x groovydoc
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: |
build
-x groovydoc
4 changes: 2 additions & 2 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
release_notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check if it has release drafter config file
id: check_release_drafter
run: |
Expand All @@ -24,7 +24,7 @@ jobs:
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
# If it has release drafter:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
40 changes: 24 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
GIT_USER_EMAIL: behlp@unityfoundation.io
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
Expand All @@ -35,12 +35,18 @@ jobs:
- name: Set the current release version
id: release_version
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
# Publish a Gradle build scan so you can see all the build logs,
# a complete task timeline, test outputs, and the resolved dependencies of your build.
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- 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 @@ -55,7 +61,10 @@ jobs:
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: Publish to Sonatype OSSRH
id: publish
uses: gradle/gradle-build-action@v2
run: >
./gradlew -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeSonatypeStagingRepository
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
Expand All @@ -64,11 +73,6 @@ jobs:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
with:
arguments: |
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeSonatypeStagingRepository
release:
needs: publish
runs-on: ubuntu-latest
Expand All @@ -80,17 +84,21 @@ jobs:
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Nexus Staging Close And Release
uses: gradle/gradle-build-action@v2
run: >
./gradlew findSonatypeStagingRepository
releaseSonatypeStagingRepository
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: |
findSonatypeStagingRepository
releaseSonatypeStagingRepository
- name: Run post-release
if: success()
uses: micronaut-projects/github-actions/post-release@master
Expand Down
Loading