Skip to content

Commit

Permalink
update gradle actions
Browse files Browse the repository at this point in the history
Replace gradle-build-action with setup-gradle as [suggested in
README][1]. Remove gradle-wrapper-validation since [setup-gradle
performs it][2]. Do not set up signing username/password in pre-merge
check because [external pull request actions do not have access to
repository secrets by default][3] and we don't want to change it.

[1]: https://github.com/gradle/gradle-build-action?tab=readme-ov-file
[2]: https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#gradle-wrapper-validation
[3]: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
  • Loading branch information
nkly-wolt committed Aug 22, 2024
1 parent 8d7b5a4 commit a60e8e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

27 changes: 12 additions & 15 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run tests
uses: gradle/gradle-build-action@v2
with:
arguments: test
run: ./gradlew test
publish:
name: Check that the publish plugin works
runs-on: ubuntu-latest
needs: [tests, lint]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Check that the publish plugin works
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
uses: gradle/gradle-build-action@v2
with:
arguments: publishToMavenLocal
run: ./gradlew publishToMavenLocal
lint:
name: Check that the code is formatted
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Check that the code is formatted
uses: gradle/gradle-build-action@v2
with:
arguments: spotlessCheck
run: ./gradlew spotlessCheck
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
- ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JVM
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-package: jdk
- name: Gradle Wrapper Validation
uses: gradle/[email protected]
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish to repository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
Expand Down

0 comments on commit a60e8e6

Please sign in to comment.