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

Conversation

tylervz
Copy link

@tylervz tylervz commented Jun 21, 2024

Update the GitHub actions workflows to use the latest version of multiple actions, including actions/checkout, actions/setup-java, actions/cache, and release-drafter/release-drafter:

https://github.com/actions/checkout/tags
https://github.com/actions/setup-java/tags
https://github.com/actions/cache?tab=readme-ov-file#v4
https://github.com/release-drafter/release-drafter/tags

- 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

@@ -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.

There are no breaking changes in this release:
https://github.com/release-drafter/release-drafter/releases/tag/v6.0.0

@tylervz
Copy link
Author

tylervz commented Jun 21, 2024

I did not upgrade the "Build and install groovy (no docs)" step in groovy-joint-workflow.yml, because I did not see a suitable replacement using gradle/actions/setup-gradle@v3.

If I replaced it with gradle/actions/setup-gradle@v3 like so:

- 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"
# Use the Gradle wrapper in the ../groovy directory
- name: Build and install groovy (no docs)
  run: |
    cd ../groovy
    ./gradlew install \
      -x groovydoc \
      -x javadoc \
      -x javadocAll \
      -x groovydocAll \
      -x asciidoc \
      -x docGDK
  env:
    GRADLE_SCANS_ACCEPT: yes
    GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}

Then the gradle/actions/setup-gradle@v3 step in the example above is useless since it is configuring Gradle in the root directory for optimal execution rather than the Gradle wrapper in ../groovy that is actually going to get used.

I do not see any inputs/parameters for gradle/actions/setup-gradle@v3 similar to build-root-directory to have it configure a Gradle wrapper in a directory other than the root directory.
https://github.com/gradle/actions/blob/main/setup-gradle/action.yml

Update: perhaps we should update the step to be the same as it is in grails-core?
https://github.com/grails/grails-core/blob/6.2.x/.github/workflows/groovy-joint-workflow.yml#L103-L119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants